callback google play on installed app

1k views Asked by At

We are creating an app where you can share an app, which sends the user to the google play store to download another app. My question is, how can I know if some user actually downloaded and installed that app? Is there a some sort of callback you get from the play store?

3

There are 3 answers

0
Aleksandar Despotovski On

Try calling startActivityForResult() with the Play Store intent. Then, override the onActivityResult() method in your Activity and check if the app is installed. This might help: How to check programmatically if an application is installed or not in Android?

1
hakki On
isAppInstalledBefore("com.example.anappblabla");

private boolean isAppInstalledBefore(String packageName) {
    PackageManager pm = getPackageManager();
    boolean installed = false;
    try {
       pm.getPackageInfo(packageName, PackageManager.GET_ACTIVITIES);
       installed = true;
    } catch (PackageManager.NameNotFoundException e) {
       installed = false;
    }
    return installed; //returns boolean
}
0
Laurent Meyer On

No, but:

What I would do is trying to get the package name (generally in the URL for example: https://play.google.com/store/apps/details?id=dev.laurentmeyer.contactautocompleteview of the target app (which is unique): something like dev.laurentmeyer.whateverApp (it's the one I'm personally using). Then scan the installed apps with this Helper and you'll be sure if it has been installed or not.