Android Build Hacks #1 — build basics

Image for post
Image for post
Photograph of a Workman on the Framework of the Empire State Building.

Build configuration!

Types and Flavors

Default config for all builds

Build Types

Build config “inheritance”

Product Flavors

Image for post
Image for post
Build variant selection

Dealing with Flavor Hell

Build variant filtering

Build settings

applicationId

Setting application ID for development builds

buildConfigField

Setting values accessible in app inside build config

resValue

Setting resource values inside build config

manifestPlaceholders

Setting manifest placeholders
android:label="${appName}"

versionNameSuffix

Setting version name suffix

resConfigs

Limiting resources for development builds

Splits

Usage of density and ABI splits
Calculating version number according to APK split variant

End of part #1

Android Developer

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store