• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

What is a BuildType in Gradle? And what can you use it for?

You can configure different build types depending on your intended deployment.
Example:

Code:
android {
    defaultConfig {
        manifestPlaceholders = [hostName:"www.example.com"]
        ...
    }
    buildTypes {
        release {
            minifyEnabled true
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }

        debug {
            applicationIdSuffix ".debug"
            debuggable true
        }

        /**
         * The `initWith` property allows you to copy configurations from other build types,
         * then configure only the settings you want to change. This one copies the debug build
         * type, and then changes the manifest placeholder and application ID.
         */
        staging {
            initWith debug
            manifestPlaceholders = [hostName:"internal.example.com"]
            applicationIdSuffix ".debugStaging"
        }
    }
}

See here for a fuller explanation:

https://developer.android.com/studio/build/build-variants
 
I see LV has graciously answered your rather impolite demand. For what it's worth, a 'please' or 'thanks in advance' can go a long way.

Don't worry Moody. It's a kind of bonus when someone does actually acknowledge, or give thanks for the free advice they get ;)
But I thank you for your recognition.
 
Back
Top Bottom