Reputation: 11053
I like the app to find out from where it was installed, like from GooglePlay, Amazon or just by installing it locally.
So when the app starts it knows where it came from.
Is that possible somehow?
Upvotes: 1
Views: 521
Reputation: 5595
Use the method String getInstallerPackageName (String packageName)
.
For more information see this
you can use this method as:
String market=context.getPackageManager().getInstallerPackageName(context.getPackageName());
As far as I remember Amazon returns "com.amazon.venezia"
and Google Play Store returns "com.android.vending".
Upvotes: 2