Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Pay - How to detect if Android Pay is installed?

There is this code (taken from https://stackoverflow.com/a/5016624/1369016):

private boolean isAppInstalled(String packageName) {
   PackageManager pm = getPackageManager();
   boolean installed = false;
   try {
      pm.getPackageInfo(packageName, PackageManager.GET_ACTIVITIES);
      installed = true;

   } catch (PackageManager.NameNotFoundException e) {
      installed = false;
   }
   return installed;
}

But I don't know what to put in the packageName. I tried com.google.android.gms.wallet (which is the package of some Wallet fragments used by Android Pay) but the above method returns false.

like image 309
Bitcoin Cash - ADA enthusiast Avatar asked Oct 18 '25 13:10

Bitcoin Cash - ADA enthusiast


1 Answers

It turns out the package name required is "com.google.android.apps.walletnfcrel". With that you can call the method in the question to detect if Android Pay is installed.

like image 157
Bitcoin Cash - ADA enthusiast Avatar answered Oct 21 '25 04:10

Bitcoin Cash - ADA enthusiast