4

I have 3 build types (debug, UAT and release) and 2 flavors (international and local).

I have my app name defined in a xml file named "product_name.xml":

<resources xmlns:tools="http://schemas.android.com/tools"
    tools:ignore="MissingTranslation">

   <string name="app_title">Awesome App</string>

</resources>

I want to change the app name based on the build variant (build type + flavor). E.g:

  • For variant InternationalDebug -> Awesome App (intl) debug
  • For variant InternationalUAT -> Awesome App (intl) UAT
  • For variant LocalUAT -> Awesome App (local) UAT

and so on.

How would I do about this? All the examples I've seen show me how to change the name based on either build type or the flavor but not both.

0

1 Answer 1

4

You could create src-folders for your variants and place your custom strings there:

src
|-> InternationalDebug
|   |->res/values/strings.xml <-- place your app_title here
|-> LocalUAT
|   |->res/values/strings.xml <-- place your app_title here
|-> main (contains your main source code.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.