Identify app is installed in the device

If you want to know the other app is installed or not, just using PackageManager.

public boolean appInstalledOrNot(String uri) {
PackageManager pm = getPackageManager();
boolean app_installed = false;
try {
pm.getPackageInfo(uri, PackageManager.GET_ACTIVITIES);
app_installed = true;
} catch (PackageManager.NameNotFoundException e) {
app_installed = false;
return app_installed;

String uri means package name like 

<-- app is not installed-->
<-- app is installed-->


Popular posts from this blog

Clear the app data programmatically in android

convert an integer to a string in java

Print the large string values in android log cat.