开发者

how to manage multiple editions of the same android app

开发者 https://www.devze.com 2023-01-24 14:19 出处:网络
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.

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 ?


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.


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.


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)


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消