1.

How to set app_name based on the built type and build flavor?

Answer»

For this, we can modify our BUILD Gradle file of the application. In Gradle file we will add CODE for ADDING build TYPE and build flavour like below:

buildTypes {    debug {        applicationIdSuffix '.debug'        versionNameSuffix '-DEBUG'        resValue "string", "app_name", "AppName debug"    }    release {        minifyEnabled true        shrinkResources true        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'        signingConfig signingConfigs.release        zipAlignEnabled true        resValue "string", "app_name", "AppName"    } }


Discussion

No Comment Found

Related InterviewSolutions