Tutorial by Examples

android { ... defaultConfig {...} buildTypes {...} productFlavors { demo { applicationId "com.example.myapp.demo" versionName "1.0-demo" } full { applicationId "com.example.myapp.full"...
You can use gradle to have BuildConfig constants and res values on a per flavor basis. Just add the value to the flavor you want to support. android { defaultConfig { resValue "string", "app_name", "Full App" buildConfigField "boolean",...
When the app is based on more than one criteria, instead of creating a lot of flavors you can define flavor dimensions. The flavor dimensions define the cartesian product that will be used to produce variants. Example: flavorDimensions("dimA", "dimB") productFlavors { ...
You can add different dependencies for a specific product flavor. Just use the <flavorName>Compile 'group:name:x.y.z' syntax: android { ... productFlavors { flavor1 { //..... } flavor2 { //..... } } } ... d...
productFlavors { // Define separate dev and prod product flavors. dev { // dev utilizes minSDKVersion = 21 to allow the Android gradle plugin // to pre-dex each module and produce an APK that can be tested on // Android Lollipop without time c...

Page 1 of 1