I\'m creating different flavors using gradle for 2 small android apps ,i wanna just know if i can edit app name on the xml file in the build.gradle , for my different flav
What do you mean by app name
? the application package name in the manifest or the application name as it appears in the launcher?
If the former, do:
android {
productFlavors {
flavor1 {
packageName 'com.example.flavor1'
}
flavor2 {
packageName 'com.example.flavor2'
}
}
}
It's possible to override the app name as well but you'd have to provide a flavor overlay resource instead.
So create the following files:
src/flavor1/res/values/strings.xml
src/flavor2/res/values/strings.xml
And in them just override the string resource that contains your app name (the one that your manifest use for the main activity label through something like @string/app_name
). You can also provide different translations as needed.