Android / Gradle: application name based on assembly type * and * product

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

I have my application name defined in an XML file with the name "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 application name based on the build option (build type + flavor). For instance:

  • For debugging option InternationalDebug -> Awesome App (intl)
  • For InternationalUAT option β†’ Awesome App (intl) UAT
  • For option LocalUAT -> Awesome App (local) UAT

etc.

What would I do? All the examples that I saw show me how to change the name based on the type of assembly or taste, but not .

+4
source share
1 answer

You can create src folders for your options and place your own lines 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. 
+4
source

All Articles