Is there any way to know if an application has been downloaded from Amazon App Store or Google Play Store? I meant within the app itself, of course.
I have deployed an a
In Code:
final PackageManager packageManager = getPackageManager();
try {
final ApplicationInfo applicationInfo = packageManager.getApplicationInfo(getPackageName(), 0);
if ("com.android.vending".equals(packageManager.getInstallerPackageName(applicationInfo.packageName))) {
// App was installed by Play Store
}
} catch (final NameNotFoundException e) {
e.printStackTrace();
}
"com.android.vending" tells you it came from the Google Play Store. I'm not sure what the Amazon Appstore is, but it should be easy to test using the above code.
Via ADB:
adb shell pm dump "PACKAGE_NAME" | grep "vending"
Example:
adb shell pm dump "com.android.chrome" | grep "vending"
installerPackageName=com.android.vending