Adding product flavor-specific resources

suggest change

Resources can be added for a specific product flavor.

For this example, assume that two product flavors, free and paid, are already defined. Flavor-specific resources live in source sets next to main. This example defines a status string for each flavor.

src/main/res/values/strings.xml

<resources>
    <string name="status">Default</string>
</resources>

src/free/res/values/strings.xml

<resources>
    <string name="status">Free</string>
</resources>

src/paid/res/values/strings.xml

<resources>
    <string name="status">Paid</string>
</resources>

The flavor-specific status strings override the value from the main source set.

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents