Skip to content Skip to sidebar Skip to footer

How To Open Google Play Store App From My App To Install The Latest Version Of My App Available On Play Store

I have a question regarding the app upgrade scenario from the app. Basically I am sending the app version from app to application server and then deciding whether to show the app u

Solution 1:

I would recommend against what you are trying to do. Is there a reason you need to notify users in app to update? The Play Store will notify them, and even automatically update your app in the background if there is an update.

Keep in mind that the Play Store rolls out your app updates. It's possible that you could redirect the user to the Play Store to update your app, and the update isn't yet available for them. This isn't usually a huge time frame, but it exists.

If you must do it, then to accomplish your first request you could add the new task flag to the intent. This will make the new activity launch as a new task in the history.

try {
    Intenti=newIntent(Intent.ACTION_VIEW, Uri.parse("market://details?id=" + appName));
    i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
    startActivity(i);
} catch (android.content.ActivityNotFoundException anfe) {
    ...
}

The second issue you're having is because you have the latest version installed. If there is, in fact, an update available then you will get buttons saying "Update" and "Uninstall".

Solution 2:

1) From your code, if play store app is installed it will launch playstore with your app listed.

2) You get the update option in play store only if the current version installed in the phone is less than the version available in the play store.

Post a Comment for "How To Open Google Play Store App From My App To Install The Latest Version Of My App Available On Play Store"