I downloaded apk file from url(my server) and save it in sdcard. If user install it from sdcard, I want to know, whether is any notification that app is installed successfully or is app istalled in device. Is there any callback on installed app
Call the method isPackageInstalled() : boolean isAppInstalled = isPackageInstalled("com. android. app" , this.
Go to Settings and find the App Management or Apps section, depending on your phone. If you can't locate it, simply perform a quick search within Settings. Once in App Management, tap on See All Apps or App Settings to see the list of apps installed on your device, excluding the system apps.
You can see all the apps you've ever downloaded on your Android phone by opening the "My apps & games" section in your Google Play Store. The apps you've downloaded are divided into two sections: "Installed" (all the apps currently installed on your phone) and "Library" (all the apps that aren't currently installed).
try this code :
protected boolean isAppInstalled(String packageName) {
Intent mIntent = getPackageManager().getLaunchIntentForPackage(packageName);
if (mIntent != null) {
return true;
}
else {
return false;
}
}
to get the package name of the app easily : just search your app in the google play website
, and then you will take the id parameter ( it is the package name of the app) . Example :
you will search on Youtube app on google play , and you will find it in this url :
https://play.google.com/store/apps/details?id=com.google.android.youtube&feature=search_result#?t=W251bGwsMSwxLDEsImNvbS5nb29nbGUuYW5kcm9pZC55b3V0dWJlIl0.
the package name is the id param, so it is : com.google.android.youtube
And then when you want to test , you will just have :
String packageName = "com.google.android.youtube";
boolean isYoutubeInstalled = isAppInstalled(packageName);
PLUS : if you want to get the list of all installed apps in you device , you can find your answer in this tutorial
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With