开发者

How can I handle package names better while building a suite of android applications

I'm building a suite of applications, meaning that I have a single set of code that gets customized via a single change of an API key. This means that all of the applications have the same activities, same behaviors, but different icons, package names, and application names depending on the client I am building for.

Unfortunately, I haven't figured out a clean way to do this. Because the package name is what the Android Marketplace uses, I've been changing it to com.nilobject.productname.clientname. However, this changes the package for all of the activities to no longer be in the pa开发者_C百科ckage of the application, since they live in "com.nilobject.productname." Additionally, the autogenerated "R" moves, so all of the references to R in com.nilobject.productname break.

Has anyone else dealt with this problem? I'm using Eclipse for development. Should I just refactor the activities with each build to be in the same package? Is there a system for this that I don't know about?

Thanks for any ideas and help!


I've been down this road with 3 different projects. One app needed "regular" and "pro" versions, another needed a versions of the same app for each of the US States, and another project involved delivering the same app to 3 different clients with each having slightly different graphics and colors.

Anyway, this is the approach that has worked best for me, and I've used it in all 3 of the multi-target projects I've been working on...

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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜