0

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?

SHA2NK
  • 189
  • 2
  • 12
  • Possible duplicate of [How to check programmatically if an application is installed or not in Android?](http://stackoverflow.com/questions/11392183/how-to-check-programmatically-if-an-application-is-installed-or-not-in-android) – Jared Rummler Nov 20 '16 at 07:31
  • Just edited the question to make it more precise. – SHA2NK Nov 25 '16 at 05:51

1 Answers1

4

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");

Rakshit Nawani
  • 2,604
  • 14
  • 27