Check Android app download from store

Depending on where the user downloaded the application, I would like the application to behave slightly differently. I clearly want to know if it was downloaded from public storage (I don't care which store), or if it was installed manually or via the Google Play / Alpha beta.

So, if it was installed manually or through the Alpha / Beta channel, it acts in one way, if it was installed from any public repository (i.e. it is a consumer version), it acts in a different way.

Most of the answers on SO mention the use of "PackageManager.getInstallerPackageName ()" which will return null (or "") if manually set, but is that guaranteed if loaded from the alpha beta pipeline?

thank

+3


source to share


1 answer


Yes. it works. you must know the actual package name to compare.



+2


source







All Articles