Bart Bergmans
Bart Bergmans

Reputation: 4121

Multiple apps, single codebase

We made an app for a client of us but he wants to sell his app to his clients as a whitelabel app. It has to be almost the same app (only different API url, colors and a different package name). What would be a smart way to do this? I don't want to change every app code when there is a new feature etc. I just want to change the code once for all the apps.

Upvotes: 2

Views: 639

Answers (1)

Tomaz Wang
Tomaz Wang

Reputation: 326

I'm working on a project similar to this. I found that product flavor is very useful in this scenario.

As for package name, use different applicationId in every flavor. For the displayed app name, create different string-resource for every flavor and use string resource in AndoridManifest > application > android:label.

You can always refer to BuildConfig.FLAVOR in your java code to determine which flavor you're currently in if needed.

Some additional resource: - Build Variants

Upvotes: 2

Related Questions