You can use productFlavors in application level gradle.
flavorDimensions "tier" productFlavors { dev { dimension "tier" buildConfigField "String", "URL", "\"http://glapp/demo.php\"" buildConfigField "boolean", "ENABLE_DEBUG", "false" versionName = android.defaultConfig.versionName + " dev" applicationId = "com.abc.glnewapp.dev" resValue "string", "app_name", "GL Demo" } prod { dimension "tier" buildConfigField "String", "URL", "\"http://glapp/live.php\"" buildConfigField "boolean", "ENABLE_DEBUG", "false" applicationId = "com.abc.glnewapp.prod" resValue "string", "app_name", "GL Live" } }
Then select the build option to build apk according to the variable. You can put a lot of flour (different apk) as you want.

You can change the application icon and other drawings by adding the same res structure to the falour name folder in the src directory. Also, if you find any problem with google json, just copy google json file to src-> productflavour
For more information, visit at
source share