Manage auto update
-
Good evening I have implemented an application with auto update function. When I release new version on my server then application downloads new .apk and it starts an intent to install new .apk file. I want to change this procedure, if it's possible. Before installing new version, I want that application should be able to uninstall itself. How can I do? Now I'm thinking to remove all file in Android system's folder reserved to this application, but is it a good way? What can you sugest me? Thank you.
-
Good evening I have implemented an application with auto update function. When I release new version on my server then application downloads new .apk and it starts an intent to install new .apk file. I want to change this procedure, if it's possible. Before installing new version, I want that application should be able to uninstall itself. How can I do? Now I'm thinking to remove all file in Android system's folder reserved to this application, but is it a good way? What can you sugest me? Thank you.
Quote:
I have implemented an application with auto update function. When I release new version on my server then application downloads new .apk and it starts an intent to install new .apk file.
That is required. How about, you keep all of the business logic on your server side and just show the results on the Android application? This way, you won't have to push every fix to the Android application but merely the new features only.
Quote:
Before installing new version, I want that application should be able to uninstall itself.
That is done by default, your previous application is removed by the Google Play Store and then the latest version is installed. But if your application uninstalls itself then I am not sure, Google Play Store would be happy to install the new version of the application, without user intervention. It would require the user to go to Play Store and install the latest version themselves.
Quote:
Now I'm thinking to remove all file in Android system's folder reserved to this application, but is it a good way?
Of course, if the data is no longer of user, remove it. Anyways, have a look here, there is way, where you can download the APK related content later, but that is just for the applications where the content is above 100 MB. APK Expansion Files | Android Developers[^]
The shit I complain about It's like there ain't a cloud in the sky and it's raining out - Eminem ~! Firewall !~
-
Quote:
I have implemented an application with auto update function. When I release new version on my server then application downloads new .apk and it starts an intent to install new .apk file.
That is required. How about, you keep all of the business logic on your server side and just show the results on the Android application? This way, you won't have to push every fix to the Android application but merely the new features only.
Quote:
Before installing new version, I want that application should be able to uninstall itself.
That is done by default, your previous application is removed by the Google Play Store and then the latest version is installed. But if your application uninstalls itself then I am not sure, Google Play Store would be happy to install the new version of the application, without user intervention. It would require the user to go to Play Store and install the latest version themselves.
Quote:
Now I'm thinking to remove all file in Android system's folder reserved to this application, but is it a good way?
Of course, if the data is no longer of user, remove it. Anyways, have a look here, there is way, where you can download the APK related content later, but that is just for the applications where the content is above 100 MB. APK Expansion Files | Android Developers[^]
The shit I complain about It's like there ain't a cloud in the sky and it's raining out - Eminem ~! Firewall !~
Thank you for repaly. Last days I have made some tests. Now I can recal new intent to unistal my application, after downloading and storing new version in Download folder. I have found the routine to send Intent for installing the new version. Here is the code for this two procedures:
Uri packageURI = Uri.parse("package:com.example.nameapp");
Intent uninstallIntent = new Intent(Intent.ACTION_DELETE, packageURI);
startActivityForResult(uninstallIntent, PICK_CONTACT_UPDATE);
//
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setDataAndType(Uri.fromFile(new File(Environment.getExternalStorageDirectory() + "/download/" + nomeApp)), "application/vnd.android.package-archive");
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(intent);//installation is not workingBut when application executes unistallation, it is arrested and it cant't execute the install procedure (loading II intent). How can I execute II intent after unistallation? Is it possible? How can I do?