6

I have 3 editions of my android app. one free with ads, one paid and one branded with company CI.

so the difference betwenn them is minimal.

what is the best practice to manage multiple editions of this app.

  1. one project, in code if (editionA) { ... }
  2. multiple projects, reference common code in extra project
  3. or something else ?
RedBlueThing
  • 42,006
  • 17
  • 96
  • 122
clamp
  • 33,000
  • 75
  • 203
  • 299
  • 2
    Keep in mind: if you're planning to release all of them on the Android Market, they all would need to have different package names. You might consider putting base functionality into an Android library project. – Mathias Conradt Nov 12 '10 at 13:44
  • Possible dup of: http://stackoverflow.com/questions/1222302/android-multiple-custom-versions-of-the-same-app – Mathias Conradt Nov 12 '10 at 13:46

4 Answers4

8

Update on the link and detailed description;
1. Library Modules
2. Setting up Library Project


Use an Android library project for the common code, with tiny projects for each specific flavor.
Pararth
  • 8,114
  • 4
  • 34
  • 51
CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491
2

I do something similar with my apps. Common code base, several different sets of resources. I have a python script that copies my generic source from a common location to the src directory, copies the res_project directories to the res directory, updates the package names to reflect the new application package and update the AndroidManifest with the appropriate values.

I felt like there should have been a better way to do this, since your resources are already nicely segregated from your source, but had problems with an application package name that differed from my src package name. I blogged about that process in detail here.

RedBlueThing
  • 42,006
  • 17
  • 96
  • 122
1

I'd say 2, makes for the most flexibility + you can have different package names so your able to have them all installed at the same time on you device (if you want/need to)

Fredrik Leijon
  • 2,792
  • 18
  • 20
1

Create a Master activity that has all the functionality, use sub activities and layouts for the 3 types of access?

This way you only have to maintain 1 project and core functionality.

Just have an initializer on start up which detects which activity to start.

James Lockhart
  • 1,030
  • 11
  • 17