Lee Winder
Lee Winder

Reputation: 887

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

Upvotes: 3

Views: 196

Answers (1)

Arnav M.
Arnav M.

Reputation: 2609

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

Upvotes: 2

Related Questions