How can I handle package names better when building a suite of Android apps

I am building a suite of apps, which means I have one set of code that is configured with a single API key change. This means that all applications have the same actions, the same behavior, but different icons, package names, and application names depending on the client I'm building for.

Unfortunately I didn't figure out how to do this. Since the package name is what the Android Marketplace uses, I change it to com.nilobject.productname.clientname. However, this changes the package for all activities that are no longer in the application package as they live in "com.nilobject.productname". Also, the autogenerated "R" is moved, so all references to R in com.nilobject.productname break.

Has anyone else dealt with this problem? I am using Eclipse for development. Should I just refactor the activities with each assembly into one package? Is there a system for this that I am not aware of?

Thanks for any ideas and help!

+2


a source to share


1 answer


I've been on this road with three different projects. One application needs "regular" and "pro" versions, others need versions of the same application for each of the US states, and another project involves delivering the same application to three different clients, each with slightly different graphics and colors.

Anyway, this is the approach that works best for me, and I've used it in all three multi-target projects I've worked on ...



http://developer.android.com/guide/developing/eclipse-adt.html#libraryProject

+1


a source







All Articles