Search code examples
androidmarketplace

Programmatically determine if application is the MarketPlace version


I have an application that's offered in and outside of the MarketPlace.

Is there a way of determining from within the code where the application came from?

I've got a few indirect methods ...

1) I could simply infer from whether they have "Allow installation of non-Market applications" ticked ...

http://developer.android.com/reference/android/provider/Settings.html#ACTION_MANAGE_APPLICATIONS_SETTINGS

2) Or I could just make separate builds and make it explicit in the code.


Solution

  • Make it explicit in the android:versionName of each release.

    And if the code is available for people to compile their own APKs, set the android:versionName to "custom" and just change it temporarily when building for the Market.