Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to manage multiple editions of the same android app

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 ?
like image 943
clamp Avatar asked Nov 12 '10 13:11

clamp


People also ask

Can you have 2 versions of the same app on Android?

Using the Native Android Cloning FeatureSome Android devices offer native support for app cloning. It lets you run multiple copies of the same app without having to install any third-party tool. This feature is available on Samsung, Xiaomi, Oppo, and OnePlus phones, among others.

Can I publish same app with different package name?

The package name is your App's unique identity on Google Play Store. All future versions of the App need to have same package name in order to manage updates. App with a different package name can only be published as a different app with different name on the Play Store.

How do I run multiple instances of an app?

Open Two Instances Of An App Using 2Accounts On Android Enter 2Accounts, that lets you do the exact same thing as the Parallel Space app. Grab the app from the official Google Play Store and install it on your device. Open the app, choose the app you'd like to run multiple instances of, and tap on Enable at the bottom.

Can I have 2 versions of Android Studio installed?

It's possible to have multiple versions of Android Studio installed simultaneously. When we offer canary builds (or even beta builds) of the next version of the IDE, you may want to install the new version without replacing your existing stable install. respectively.


2 Answers

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.
like image 119
CommonsWare Avatar answered Nov 01 '22 13:11

CommonsWare


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.

like image 24
RedBlueThing Avatar answered Nov 01 '22 13:11

RedBlueThing