here base ingredients are your common code within the main directory which is out there to all or any flavors also, you’ll have different code directories for every flavor to make flavor-specific code like flavor ingredients.
The core principle of Product flavors in Android is the same as preparing different flavors of ice cream. The same process works with different flavors of ice cream. now you wanna have a vanilla flavor so it’s easy to do this, we need to add the below flavor ingredients to the above base ingredients.įlavor Ingredients: 2 teaspoons vanilla extract. With the above ingredients, you can make the perfect ice cream. Base Ingredients: ¾ cup white sugar, 1 cup heavy light whipping cream, 2 ¼ cups milk. To better understand product flavors allow us to consider a generic example: An example of build types are “Debug” and “Release”.
Build Types and Build Variantsīuild Variants are the result of Gradle using a specific set of rules to combine settings, code, and resources configured in your build types and product flavors.īuild Type applies different build and packaging settings.
With Android product flavors, this cost is often saved and further invested in bringing more advanced app features or new concepts to plug. Here is the official Android documentation for the configuration of Android Product Flavors. Stable/experimental to stay experiments during a different source set and generate beta versions quickly.Īndroid Product Flavors are also known as Android build types or Android build variants are the native Android app development way to implement different versions of the same application with minor changes.Free/paid flavors to get two different APKs which will be released on your distribution channels.Some typical examples of flavor dimensions are: Android Studio product flavors are a powerful feature and our Android Gradle plugin lets you swap Java/Kotlin classes at compile time and doesn’t require additional libraries.