Reputation: 3467
I want to know whether my Android application was downloaded from the Playstore or another source.
Is this possible without setting some constants at compile time and using different APK's?
Thanks
Upvotes: 1
Views: 183
Reputation: 14274
To determine whether or not the app was ever downloaded from the Play Store, you could use Application Licensing. This should pass tests, even if the app was downloaded free. However, if the user has downloaded the app, uninstalled it, then installed it from another source, it might still pass tests here.
I have a dual-sourced app, and I change the version string to end in .G
for the Play Store app, and a different postfix for the other source. Yes, it requires me to maintain two packages, but at least I don't need to change the package name. Conceivably, I could automate that, as it's only an element in the manifest.
Upvotes: 3