Auto-Update for (private) Android apps –

Development issue/problem:

I am developing a non-public Android application, which means that the application will not be available on the global Android market. The application is installed on a limited number of customers, e. B. with an apk file.
How do I enable the automatic update function in this application?

I see several possible options (I don’t know if they are technically difficult or impossible to implement, or if there are existing functions that can be reused):

I prefer the first option because the automatic update function is included in the application, which requires less development effort.

How can I solve this problem?

Solution 1:

Janjonas, in the company where I work, we had a similar problem with Windows Mobile 6.x, and we use about the same solution as the one indicated by EboMike:

The main application checks if it is up to date with WebService. It retrieves the current version and the URL from which the new version can be downloaded if necessary. The main application then starts the update application, sends the URL and exits.

The update tool performs an HTTP download of a new program and displays the % downloaded to the user. The user can interrupt a download at any time in a controlled manner, and Updater can record this interruption.

After downloading a new application, the update program starts and stops.

Solution 2:

I think the first option is the least demanding for you, and even the cleanest, since it goes through the Android embedded package installer, which includes a custom notification and the possibility for the user to stop the installation if he wants.

You’re already done – check the new version on the server (it would be nice to give the user the option to disable it) and if there is a new version, you can either just link the URL to the MOTK (which, with IICR, will use your browser’s download manager for the download) or you can download it with your application and then point the resolution to your local file. Using an HTTP link is technically less time consuming and cleaner – the more you let the operating system do, the better – unless there is a reason not to.

Solution 3:

Activation of a non-commercial application is always required for any application outside Google Play. If it is not enabled, the installation process will ask for it and redirect the user to the application settings to install the application.

Depending on your needs, you can delegate a third of the library.

Solution 4:

Here are some of the authorizations we use for this purpose:

Let me explain a little… The last one, WRITE_EXTERNAL_STORAGE, speaks for itself. With ACCESS_SUPERUSER we tell the system that we are going to use the root privileges. READ_EXTERNAL_STORAGE will be needed in the future to enable your application to read the files on the SD card.

Assuming that you have downloaded the file and that all these devices can be rebooted (limited number of customers, not in the game, etc.), you can do this:

String filePath = Environment.getExternalStorageDirectory().toString() + /Your_App_Directory/Your_App_Filename.apk ;
process installProcess = null ;
int installResult = -1337 ;

try {
installProcess = Runtime.getRuntime().exec(su -c pm install -r + filePath);
} catch (IOException e) {
// Handle the IOException as you like.
}

If (installProcess != null) {
try {
installResult = installProcess.waitFor();
} catch(InterruptedException e) {
// Handle the InterruptedException as you like.
}

if (installation result == 0) {
// Success!
} other {
// Error. :-/
}
} other {
// Fail 2 🙁
}

Solution No 5:

This method can be very cumbersome, but for some companies, if you think it is applicable, it can be very easy to implement.

  • Create a passwordActivity screen that asks for a password to access the application.
  • Once the password is entered, raise the flag (set a boolean value from false to true using the current default settings).
  • Put the .apk file in the Google Shop.
  • Change the password after everyone has installed the application and share a new update in the Google Play store.

Since the program stores the flag value in memory, the change of password is not even displayed on the password screen. It only appears for new installations, so you may have to repeat the process.

Pay attention: This method can be more effective if the application is not used by hundreds of users. And don’t forget that this method is also dangerous. Summarized: If you are looking for a way to keep the app private and not worry about security, I recommend this solution.

Solution No 6:

Application update
Check if you have already downloaded the new apk.

void installNewVersion(String location) {

Intent = new intention (Intent.ACTION_VIEW);
intention.setDataAndType(Uri.fromFile(new File(location + app-debug.apk)),
app/vnd.android.package-archive);
intention.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(intention) ;

}

Good luck!

Related Tags:

apps update automatically,android app update notification,update all apps,online app update,in-app update android,turn off auto-update for specific apps android,apps not auto updating android,in-app update priority android,how to notify users about an android app update,update android app without google play,how android app update works,android force update,android app version check and update,update app without play store android studio,apps still auto updating,how to stop an app from updating android,do not auto update apps not working