[Android] Checking whether apk is installed


Writing time : 2016-03-27 17:43:30

Checking whether apk is installed

If you know the package name, you can check whether it is installed using PackageManager.

private boolean isPackageInstalled(String packagename, Context context) {  
PackageManager pm = context.getPackageManager();  
try {  
pm.getPackageInfo(packagename, PackageManager.GET_ACTIVITIES);  
return true;  
} catch (NameNotFoundException e) {  
return false;  
}  
}  

Reference URL


http://stackoverflow.com/questions/18752202/check-if-application-is-installed-android

Previous post