我有3种构建类型(调试,UAT和发布)和2种口味(国际和本地)。
我的应用名称在名为“product_name.xml”的xml文件中定义:
<resources xmlns:tools="http://schemas.android.com/tools"
tools:ignore="MissingTranslation">
<string name="app_title">Awesome App</string>
</resources>
我想根据构建变体(构建类型+风格)更改应用程序名称。 E.g:
等等。
我该怎么做?我见过的所有示例都向我展示了如何根据 构建类型或风格来更改名称,但不是两者。
答案 0 :(得分:4)
您可以为变体创建src文件夹,并将自定义字符串放在那里:
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.