How to know an application is installed from google play or side-load?

ttom picture ttom · May 30, 2012 · Viewed 29.4k times · Source

I need to detect my application is installed from google play or other market, how could I get this information?

Answer

MattC picture MattC · May 30, 2012

The PackageManager class supplies the getInstallerPackageName method that will tell you the package name of whatever installed the package you specify. Side-loaded apps will not contain a value.

EDIT: Note @mttmllns' answer below regarding the Amazon app store.