I want to make development easier by implementing a configuration parameter that determines whether the app should be run in ‘DEV’ mode or ‘PROD’ mode.
I want this parameter to be accessible from any file (based on this parameter different chunks of code will be executed).
What’s the most practical way to store this parameter (which isn’t accessible or changeable by the user)?
How can I access it from within the application?
Starting with ADT 17 (IIRC), you have this automatically as part of the auto generated
BuildConfigclass.The
DEBUGfield is alwaystruewhen developing, but when you export a signed or unsigned apk, it is set tofalse. You can use it as:Or the other way around: