@hidro is great, but requires an unnecessary call to getResources()... every time you want to access a value.
There is another possibility:
build.gradle
android { buildTypes { debug { buildConfigField "boolean", "DEBUG_TOAST_LOGS", "true" } release { buildConfigField "boolean", "DEBUG_TOAST_LOGS", "false" } }
}
Then in your code you can write:
if (BuildConfig.DEBUG_TOAST_LOGS) {
source share