Whether the app installed is called Google Play or Market, the package name is the same com.android.vending.
I need to be able to detect whether the app
You can use this simple piece of code, its easy and to the point with a consideration for not re-inventing the wheel using GooglePlayServicesUtil:
public static boolean isPlayStoreInstalled(Context context){
try {
context.getPackageManager()
.getPackageInfo(GooglePlayServicesUtil.GOOGLE_PLAY_STORE_PACKAGE, 0);
return true;
} catch (PackageManager.NameNotFoundException e) {
return false;
}
}
This will require you to add this to your dependencies:
compile 'com.google.android.gms:play-services-base:[PLAY_SERVICES_VERSION]'
Latest play-services version is now: 10.0.1