-1

So I will be white labeling an app soon. The whitelabel will simply be a replacement of graphics (with same name) and also some colors and string (.xml files). There will also be some config changes such as API keys etc.

I'm just wondering would it be possible to do this with ant. For example I could call ant company_a and ant company_b

Has anybody done this? Thanks.

jim
  • 8,670
  • 15
  • 78
  • 149
  • 1
    You need to change (de-conflict) the package name too, everywhere that it occurs! You could use find, xargs, and sed to do it, or perhaps there's a refactoring tool you can automate similar to the capabilities in eclipse. – Chris Stratton Dec 16 '12 at 16:08

1 Answers1

1

We're white-labeling software a little bit different, just using Eclipse as our primary development environment:

  • The main application code goes into an actual Android library project - this includes all Activities, Fragments, layout XMLs and default graphics. Just about everything.
  • For every customer we create a dedicated APK project with a dedicated Package Name (also see Chris Stratton's comment to your question). This APK simply links the library above. It consists of nothing more than an AndroidManifest.xml referencing the necessary Activities, Services, etc.
  • Now we can customize nearly everything of the App very easily:
    • Replace a graphic: Simply add a new graphic resource to the APK project with the same name as the original one you want to replace.
    • Customize a string: Just add a new strings.xml that overwrites an existing definition
    • Customize layout: Overwrite a layout definition by simply using the same file name.
    • etc.

This is a very easy and efficient approach for us. It gives nearly unlimited possibilities with little maintenance effort and full Eclipse integration for development and debugging.

Building an Ant script on top of that should be pretty straight forward, too.

André
  • 2,101
  • 20
  • 23
  • I need to white label my app, but I've never taken an existing Android project and moved the application code into a library. Any resources that could walk me through it? – Andrew Jan 22 '14 at 20:53
  • This StackOverflow question might help: http://stackoverflow.com/questions/4085313/how-to-create-your-own-library-for-android-development-to-be-used-in-every-progr – André Jan 26 '14 at 15:40
  • This is should be the accepted answer. Excellent approach. – Clive Jefferies May 15 '14 at 14:41