Despite your insistence that this is not about packing common code into Android libraries, it's kind of like. You have stated that markets may have different requirements or have a free and paid version. In each of these examples, your two final output APKs have different behavior and / or resources. You can put the vast majority of your code into the Android shared library, and then save the differences in your actual projects.
For example, I worked on applications where they need to be released both on the Android Market and in the Amazon AppStore. The Amazon AppStore requires that if you link to the market page for the application, it must be Amazon (as opposed to the Android Market page). You can save the URL in a resource in the library and use it in your code, but then redefine that resource in your Amazon project to point to the corresponding Amazon URL.
If you structure it correctly, you can do similar things in code, because your starting point is your application object, which you can subclass and do different things.
However, if you want to add an Ant step that changes the package name in the manifest, it is just XML. This should not be difficult to change as a precompilation step.
kabuko Sep 21 '11 at 23:25 2011-09-21 23:25
source share