I developed one Android application in the same project with Eclipse - it is structured (from the iPhone), so one constant determines whether this is a demo or a full version.
Now I have a problem that every time I want to create a demo, I need to change the constant, but I also need to make a copy of the project with a different package name.
Obviously, the code change in the original full version must be copied to the demo version or I will have to re-create the creation of the demo application every time I submit my application.
I see three possible approaches:
1. Although I studied library projects, it is still not clear to me how this really gives a good solution in this case.
For example, if I have a full version with an activity structure:
A1 A2 A3
using utility classes U1, U2
Of course, U1 and U2 can be in the library project and refer to both projects - but the actions, strings.xml, graphics, layouts should be duplicated (or is there another way that I do not see?) This does not seem to be a good step forward and, unfortunately, it was not explained in similar questions on this topic when this approach was proposed.
2. Another way is to create different package names based on different build settings (similar to iPhone), but this is not possible in Eclipse, and not using external scripts (which, frankly, I avoid, because it seems more error prone), but compilation must also be called outside of Eclipse
3. Probably the most direct approach (as well as currently with little effort) is to simply manually copy the project, change one constant, rename the package and compile / export every time I submit. This, however, seems to be pretty βbasicβ and, of course, does not look professional (compared to setting up the iPhone / xCode / build solution as a target).
What would be the best approach (requiring minimal changes and still stable and easy to use)?
Thank you very much!
EDIT
For everyone who tried tim, it works just fine, however I ran into a problem with custom attributes.
Check this out: How do I set custom attributes for Android libraries and reassign package names at build time? it will allow isse for libraries