android tutorial - Adding product flavor specific resources in Android | Developer android - android app development - android studio - android app developement
Adding product flavor-specific resources
- Resources can be added for a specific product flavor.
For this example, assume that we have already defined two product flavors called free and paid. In order to add product flavor-specific resources, we create additional resource folders alongside the main/res folder, which we can then add resources to like usual. For this example, we'll define a string, status, for each product flavor:
/src/main/res/values/strings.xml
<resources>
<string name="status">Default</string>
</resources>
click below button to copy code from our android learning website - android tutorial - team
/src/free/res/values/strings.xml
<resources>
<string name="status">Free</string>
</resources>
click below button to copy code from our android learning website - android tutorial - team
/src/paid/res/values/strings.xml
<resources>
<string name="status">Paid</string>
</resources>
click below button to copy code from our android learning website - android tutorial - team
- The product flavor-specific status strings will override the value for status in the main flavor.