Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Checking if Android app is downloaded from a store

Depending on where the user downloaded an app, I'd like the application to behave slightly differently. I explicitly want to know whether it was downloaded from a public store (I don't care which store) or whether it was installed manually or through the Google Play Beta/Alpha 'store'.

So if it was installed manually, or via the Alpha/Beta channel, it acts one way, if it was installed from any public store (i.e. it's the consumer version) it acts another way.

Most answers on SO mention using 'PackageManager.getInstallerPackageName()' which will return null (or "") if it's manually installed, but is this guaranteed to be case if downloaded from the alpha/beta pipeline?

Thanks

like image 647
Lee Winder Avatar asked Mar 07 '26 17:03

Lee Winder


1 Answers

yes. it works. you must know the actual package name of the stores to compare.

like image 185
Arnav M. Avatar answered Mar 10 '26 06:03

Arnav M.



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!