Android build.gradle works well with Debug and Release Environment.
Add the following code snippet to the build.gradle file
buildTypes { debug { buildConfigField "Boolean", "IS_DEBUG_MODE", 'true' } release { buildConfigField "Boolean", "IS_DEBUG_MODE", 'false' } }
Now you can access the variable as shown below
if (BuildConfig.IS_DEBUG_MODE) { { //Debug mode. } else { //Release mode }
Zumry Mohamed Dec 09 '16 at 4:37 2016-12-09 04:37
source share