2
  1. Once an update to app is submitted in Google play developer console and the app is visible to all users, how much time would it take for any device to pick the update? (Assuming active internet wifi connection is throughout the day and auto-update is on for this app)

  2. Can I programmatically initiate a request to Google play store regarding the update WITHOUT ANY USER PROMPT OR ANY INTERACTION? (Assuming no new permissions are requested while updating). If so, please suggest how.

Other information: My app is designed for digital signage using android boxes. App is launched on startup, occupies the screen. There will not be any sort of user interaction directly with the app during its lifetime.

Cœur
  • 37,241
  • 25
  • 195
  • 267
jay
  • 1,982
  • 2
  • 24
  • 54
  • This is a duplicate of http://stackoverflow.com/questions/28194028/how-can-i-trigger-the-google-play-stores-auto-update-mechanism – user1506104 Oct 05 '16 at 11:21
  • yes you can check the installed application apk version and play apk version if it greater then redirect to play store – Ganesh Gudghe Oct 05 '16 at 11:23
  • @user1506104 - That question offers NO SOLUTION. Please mark as duplicate only if there is atleast one suggested solution in other threads. – jay Oct 05 '16 at 11:46
  • @Ganesh Gudghe - I have considered that, but the requirement is triggering update (without any new permissions) without user interaction. Reason is mentioned in the question, please check. Thank you – jay Oct 05 '16 at 11:47
  • @jay there is no other way to update without user interaction. – Ganesh Gudghe Oct 05 '16 at 11:56
  • 1
    Marking a question as duplicate should consider the quality of question and the answers. http://meta.stackoverflow.com/questions/334533/marking-a-question-as-duplicate-should-we-consider-question-creation-time-or-sc/334535#334535 – jay Oct 05 '16 at 11:56
  • @GaneshGudghe - Thankyou sir, that information really helps – jay Oct 05 '16 at 11:57

3 Answers3

4
  1. Usually update is installed within 24 hours, provided the user maintains active connection with internet and sufficient battery. Android boxes do not have any battery, so automatic updates via google play (without any user interaction) are not reliable.

  2. Use this code for issuing auto update without playstore.

Add this permission: <uses-permission android:name="android.permission.ACCESS_SUPERUSER" />

Use the following function:

public static void installAPK(String filename) {
    File file = new File(filename);
    if (file.exists()) {
            Runtime.getRuntime().exec("chmod 777 " + filename);
            String command;
            command = "pm install -r " + filename;
            Process proc = Runtime.getRuntime().exec(new String[]{"su", "-c", command});
            proc.waitFor();
        }
}

Note: This would work only if you are not requesting any extra permissions for the app since last install.

jay
  • 1,982
  • 2
  • 24
  • 54
0
  1. It depends on Google's back end replicating your new update, usually within 8-24 hours.
  2. No, that would be a security vulnerability. Apps are not permitted to install or update themselves without user interaction.
Larry Schiefer
  • 15,687
  • 2
  • 27
  • 33
  • Why would there be security vulnerability if no new permissions are requested ? – jay Oct 05 '16 at 11:44
  • Because that would assume the user understood all previous permissions which were granted, which is not very likely. Think about an app which had permissions to get contacts, phone ID and send SMS, and it did nothing nefarious with them. Let's say an update to the app (via the original author or a hacker who was able to get access to the signing keys and play account details) becomes available which farms the contacts and phone ID then sends the details off to a SMS receiver farm to do bad things. If the app could update itself with no user interaction, this would be quite evil. – Larry Schiefer Oct 05 '16 at 13:21
0

I have been through this many times.

1> It usually took me for about 2 - 4hrs to get my app updated on google play.

2> I think you are talking about force update. What I did for this was that I made an api for checking the version of app. And according to it I redirected to update screen in google play . I hope it helps.

// Here min_supported_version is generated from api
    if (min_supported_version <= BuildConfig.VERSION_CODE) {
        startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("market://details?id=yourpackagename")));
}
incr3dible noob
  • 441
  • 2
  • 14
  • 1
    WITHOUT ANY USER PROMPT OR ANY INTERACTION. Added some extra information on the question explaining the reason. Please check – jay Oct 05 '16 at 11:44