What I do, and it may or may not be THE way to go, or meet your needs: I create a .jar from the core app, with variables set to protected that are used to configure the app or control behavior. Then create a new Android project for each app you want, import/ reference the core .jar file, and override the protected variables as appropriate. Also drop in XML layouts, icons and so forth, and modify them as needed. This latter step though is not quite as elegant, as it involves some level of (XML) code duplication, but you may be able to live with it.
With that said, plz don't flood Android Market or other marketplaces with multiple apps ***that really should be only one*** (won't name names, but we've seen'em all). That way you'd make me part of the Race To The Bottom here... At any rate, I've used this method with good success. I've been able to create editions for app submission to ADC, editions to create a highly functional app to a client who did not want to (didn't make sense) pay for the entire shebang, but was OK to license the core .jar under LGPL, sans source code. Hope this helps. On Apr 15, 2:35 am, henrik <[email protected]> wrote: > Hi. > > I need to build several slightly different apps from one code base, > where only the styling and some variables are different in each app. > > Right now I use an awful "Constants" class where I comment in/out the > correct values for each app, in addition to copying the correct > graphic resources to the res/drawable/ folder. > > One way to make this less painful would be to refer to a Java static > Constants#appVariant from styles.xml and splash.xml, e.g like this > pseudo-entry: > > <style name="Artwork"> > <item name="android:background">@drawable/ > border_{Constants.appVariant}</item> > </style> > > Is this possible? > > And I guess there are better ways of solving this. All hints are > appreciated! -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en To unsubscribe, reply using "remove me" as the subject.

