2

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 package 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!

4

1 回答 1

1

我一直在这条路上有 3 个不同的项目。一个应用程序需要“常规”和“专业”版本,另一个需要针对美国每个州的同一应用程序的版本,另一个项目涉及将同一应用程序交付给 3 个不同的客户,每个客户的图形和颜色略有不同。

无论如何,这是最适合我的方法,我已经在我从事的所有 3 个多目标项目中使用了它......

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

于 2011-01-28T08:55:11.613 回答