Is there a way to determine if the application is installed from the Market or not?

I am wondering if I can determine if my application was installed in the Android Market (it is in the download list on the market and has the right to check for updates) or not?

It would be very useful to determine if the application was installed without it, as this may mean that it was stolen and installed with an SDcard.

+22
android
Jul 05 2018-10-10T00:
source share
2 answers

In your activity do

 PackageManager pm = getPackageManager ();
 String installationSource = pm.getInstallerPackageName (getPackageName ());

installationSource will now contain the name of the application package that installed your application.

testing with the application of the mine installation source - "com.google.android.feedback" when installing through the google market, null if installed through the debugger.

+28
Apr 29 '11 at 2:35 a.m.
source share

If you are not root (and have access to the Market database), I do not think this is possible.

0
Jul 05 '10 at 10:22
source share



All Articles