I have recently started selling my Android application on the Google Android Market, and implemented their application licensing scheme to prevent against unauthorized use of my application. I am now planning on releasing it for the Amazon Android App Store as well, and want to know the best way of maintaining two versions of my application: one that implements the Android Licensing, and another that does not.
Although my current solution works, it is not optimal, and I am trying to figure out ways other people have dealt with this. Right now, I have implemented two splash screens for my application, SplashGoogle.java and SplashAmazon.java. I have two corresponding Manifest files, GoogleManifest.xml and AmazonManifest.xml. Each manifest defines a different splash as the launcher intent.
When I want to release a version of my application, I rename one of these manifest files to AndroidManifest.xml, export the application, and then do the same for the other Manifest. This is my solution because it is the best I could come up with, and do not know of other ways to go about doing this. It works because the only difference between the Amazon and the Google market versions of my application, are the corresponding splash classes, one which checks the licensing and the other which does not.
Down the road, I may want to implement additional changes (or consolidate to only have one splash screen) and am looking for a more permanent means of managing subtle changes within the same application.
I imagine that similar issues arrise when developers create lite, free, or ad-supported versions of paid applications.
Additional Notes:
- For the version that uses Google's Android Licensing, I request the CHECK_LICENSE permission in the AndroidManifet.xml file, while in the Amazon version, this is not necessary.
I am not sure if this should be considered a community wiki, but if so, please mark it as such as opposed to closing the question. I believe this would be useful to a lot of developers out there.