1

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?

user387184
  • 10,953
  • 12
  • 77
  • 147
  • 2
    no that's not possible... – Michael Shrestha Aug 22 '14 at 06:04
  • possible duplicate of [Can PackageManager.getInstallerPackageName() tell me that my app was installed from Amazon app store?](http://stackoverflow.com/questions/13289748/can-packagemanager-getinstallerpackagename-tell-me-that-my-app-was-installed-f) – Andrew T. Aug 22 '14 at 06:11

1 Answers1

2

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".

kgandroid
  • 5,507
  • 5
  • 39
  • 69