I have several Android apps in play store and when a user installs one of my apps, how can that app find out that my other apps are installed on this device or not?
I wish to search using : com.developer.*
pattern.
Can we make such check?
I have several Android apps in play store and when a user installs one of my apps, how can that app find out that my other apps are installed on this device or not?
I wish to search using : com.developer.*
pattern.
Can we make such check?
Use this function to find the application using the package name of the application you want.
private boolean appAvailable(String package_name) {
PackageManager pm = getPackageManager();
boolean installed;
try {
pm.getPackageInfo(package_name, PackageManager.GET_ACTIVITIES);
installed = true;
}
catch (PackageManager.NameNotFoundException e) {
installed = false;
}
return installed;
}
Or you can use below function also
public static boolean isAppAvailable(Context context, String packageName) {
try {
context.getPackageManager().getApplicationInfo(packageName, 0);
return true;
}
catch (PackageManager.NameNotFoundException e) {
return false;
}
}
boolean findFaceebook = isAppAvailable(context, "com.Facebook.katana");