2

Mainly this is for branding. I hope to use different set of images and drawable resources for different clients.

What I hope to achieve is that when at build phase, I could select which resources pack I need to use, but leave the source code untouched.

I know I could just create multiple projects by copy and paste, or I could create one project but change the res folder everytime I build it. What I need help is that is there a more funcional way to achieve this task?'

Thank you!

Arthur0902
  • 209
  • 3
  • 14
  • In addition to the solutions below, Maven profiles may solve the problem. Similar question: http://stackoverflow.com/questions/11340837/android-targeted-res-folders-for-debugging-in-eclipse – acj Jan 30 '13 at 17:54

3 Answers3

1

Already done:

Use a project as a library, with all the drawables (default).

Create a project that uses this library with its own package name and app name. Add to it the same drawables (names) but branded (different content). These drawables will override those of the library!

Remember to add activities and all application components and permissions to the new manifest.

Sherif elKhatib
  • 45,786
  • 16
  • 89
  • 106
  • @DmytroDanylyk in the best world, the minimum is to create a new project and add the drawables. This process can be automated or not, but this is the minimum. Probably building the same project while copying the drawable from a certain location is also a solution but it is still the same and it all depends on whether this will be automated. – Sherif elKhatib Jan 30 '13 at 18:01
  • @SherifelKhatib Thanks for your replay. I have the problem that I may need to distributes more than 15 different APKs to different clients. The only different is just some resource file such as logo, background, etc. Also I need them have different APPID so I could push them to Google Store. Is there an easier way to do this rather than create project for each of them? Thank you! – Arthur0902 Jan 30 '13 at 19:17
  • @Arthur0902 did you find a better solution?? – Jeeva Aug 10 '18 at 10:37
0

To do this you need to create another Android project and use ant to copy all necessary resources to this project and build apk file.

Dmytro Danylyk
  • 19,684
  • 11
  • 62
  • 68
0

Try gradle with flavours and build type. You can achieve different set of apk in one build. Checkout http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Build-Variants

Abhishek Jain
  • 6,296
  • 7
  • 26
  • 34