0

I developed a complete and working app, from now on called "base-app", which uses different modules and libraries, with a splash screen, activities, fragments and much more...

I would like to develop another app (more than one in future) which uses this base-app and adds more activities and functionalities. base-app it's not really a library because can be executed standalone. But I need to add customization for customers.

And I don't want to clone this app inside every new project, because for every change in base-app I should modify all derived projects.

Is there a way to do so? using this base-app as a starting point, with its launcher but adding different activity for each customer?

thanks

userLiuk
  • 83
  • 1
  • 6

1 Answers1

0

We have a similar setup for two of our apps, you need to do the following:

  1. Mark base-app as a library (right click the project name to access the properties dialog)
  2. Create a new application - base-wrapper - have it use the base-app library, and copy the AndroidManifest from base-app to base-wrapper.
  3. Create a new application - extended-wrapper - have it use the base-app library, copy copy the AndroidManifest from base-app again, and add whatever new Activities/Services you need to this project.

So now you have 2 Applications that can you can build to apks, both using the same shared code in base-app library, so you don't need to duplicate any code.

If there are some activities or code you only need in base-wrapper you can move those from the library to the wrapper application project.

marmor
  • 27,641
  • 11
  • 107
  • 150
  • works, on android studio 2.3 there is no way to "mark as a", but i resolved adding apply plugin: 'com.android.library' in build.gradle. then importing the base-app library into the new project modifing the setting.gradle defining subprojects: def subprojects = [ [name:':base-app', path:"C:/software/base-app"] ] – userLiuk Apr 06 '17 at 15:00
  • yeah, it seems they removed the "Library" checkbox in some update, i haven't used it in a while... – marmor Apr 06 '17 at 18:38