Sunday 15 February 2015

mdm - Can I update my android application using update button? -


We have created an Android application, it is a non-market application, and is deployed on the set of customers. Using MobiControl We send new updates for our application. The update is silent.

At the time of update, if the application is in use, and the user is entering any data, the application closes without user confirmation !!, the user has been upgraded to the new version Of application and it launches it again. Due to this user lose his change !! Also, as our apps are related to sensitive information, we can never write them to the physical storage of the device. Therefore, 'Maintaining and restoring' is not an option.

One thought I thought was that I could provide an 'update' button on one screen of my application (say settings) from where I can update it for the new version, for me, Code by which I can show an installation intention after passing the APK as a parameter.

  Intent promptInstall = new Intent (Intent.ACTION_VIEW) .setData (Uri.parse ("File: ///path/to/myapp.apk")) .setType ("application / vnd .android.package-archive "); StartActivity (promptInstall);   

But when the above code is executed, I get the following error.

  06-21 18: 29: 01.666: E / Android Random (8981): android.content.ActivityNotFoundException: Because of no activity found to handle intent {task = android. Intent.action.view typ = application / vnd.android.package-archive}   

worked yesterday when I said setDataAndType in a row but with the same code I still have one The problem had to be encountered ...

  06-25 10: 27: 39.383: E / Android Random (3737): Reason by: android.content.ActivityNotFoundException: Intent {act = android .intent.action.view.dat = / mnt / sdcard / test / ReinstallSample.apk No activity found to handle typ = application / vnd.android.package-archive} 06-25 10: 27: 39.383: E / AndroidRuntime (3737): android.app.Instrumentation.checkStartActivityResult (Instrumentation.java: 1622) 06-25 October: 27: 39.383: E / AndroidRuntime (3737): android.app.Instrumentation.execStartActivity (Instrumentation.java at: 1417) 06-25 October: 27: 39.383: E / AndroidRuntime (3737): android 06/25 October at :app.Activity.startActivityForResult (Activity.java:3370): 27: 39.383: E / AndroidRuntime (3737): android.app.Activity.startActivityForResult (Activity.java:3331) 06-25 October: 27: 39.383: E / AndroidRuntime (3737): on android.app.Activity.startActivity (Activity.java:3566) 06-25 October: 27: 39.383: E / Android Random (3,737): Andrew Id. App activity. Start activity (activity.Java 35 34) 06-25 October: 27: 39.383: E / AndroidRuntime (3737): 06.10 October at com.example.reinstallsample.MainActivity.launchInstaller (MainActivity.java:73): 27: 39.383 : E / AndroidRuntime (3737): com.example.reinstallsample.MainActivity.reInstall (MainActivity.java:66) 06-25 October: 27: 39.383: E / AndroidRuntime (3737): ... 14 more    

Try to use it instead, I remember that somewhere with a set the need for datatype Is in a row

  Intint prompt install = new intent (Intent.ACTION_VIEW); PromptInstall.setDataAndType (Uri.parse (filePath), "app / vnd.android.package-archive"); StartActivity (promptInstall);    

No comments:

Post a Comment