Search code examples
androidotaautomatic-updates

Remote update app on multiple devices NOT using Playstore


I'm trying to find a solution to do a remote update of an APK to 80 tablets. This should preferably be as automated as possible and if this can happen completely in the background without any user input that would be great. Basically what the Playstore currently do which I unfortunately can't use.

Is something like this possible without rooting the device? Any suggestion on libraries/ services that does this?

I'm running Android 4.1.1 and they will all be connected to a Wi-Fi.


Solution

  • You can download the new APK file to SD card, then call this to install it:

    Intent shareIntent = new Intent(Intent.ACTION_VIEW);
    shareIntent.setDataAndType(Uri.fromFile(new File("path-to-APK-file")),
            "application/vnd.android.package-archive");
    
    try {
        context.startActivity(shareIntent);
    } catch (Throwable t) {
        // handle the exception here
    }
    

    There is only one thing not automatic: the final step. The system will ask the user to confirm installation.

    About the MIME type of APK files, here's the wiki page.