5. Why Gradle?
• Declarative vs Imperative
• Flexibility & Customization
• “Convention over Configuration” , well
…convention is good but so is flexibility
6. Declarative vs Imperative
• Imperative : script how to do something, and as a
result what you want to happen will happen
• Declarative: script what you would like to happen,
and let the tool figure out how to do it
7. Declarative vs Imperative
• Imperative : script how to do something, and as a
result what you want to happen will happen
• Declarative: script what you would like to happen,
and let the tool figure out how to do it
8. Flexibility & Customization
• Supports Android’s diverse ecosystem, e.g. ABI,
density , API level etc.
• Split apks for Play Store
• Still allows you to write plugins and tasks
9. Flexibility & Customization
• Supports Android’s diverse ecosystem, e.g. ABI,
density , API level etc.
• Split apks for Play Store
• Still allows you to write plugins and tasks
10. Flexibility & Customization
• Supports Android’s diverse ecosystem, e.g. ABI,
density , API level etc.
• Split apks for Play Store
• Still allows you to write plugins and tasks
12. Android Gradle Concepts
• Build Types - how the application is packaged, and how the
compiler is called (mostly)
Debug vs Release (vs. <other>)
• Product Flavors – mostly has to do with features
paid vs. free
abi packaging
• Variants = Build Types + Flavors
freeDebug , paidRelease , paidDebug , freeRelease
13. Android Gradle Concepts
• Build Types - how the application is packaged, and how the
compiler is called (mostly)
Debug vs Release (vs. <other>)
• Product Flavors – mostly has to do with features
paid vs. free
abi packaging
• Variants = Build Types + Flavors
freeDebug , paidRelease , paidDebug , freeRelease
14. Android Gradle Concepts
• Build Types - how the application is packaged, and how the
compiler is called (mostly)
Debug vs Release (vs. <other>)
• Product Flavors – mostly has to do with features
paid vs. free
abi packaging
• Variants = Build Types + Flavors
freeDebug , paidRelease , paidDebug , freeRelease
28. Tip 5: BuildConfig.java
public final class BuildConfig {
public static final boolean DEBUG = Boolean.parseBoolean("true");
public static final String APPLICATION_ID = "com.peirr.test.debug";
public static final String BUILD_TYPE = "debug";
public static final String FLAVOR = "";
public static final int VERSION_CODE = 1;
public static final String VERSION_NAME = "1.0.debug";
}