There seem to be a couple of ways to skin this cat but one way would be:
Example adding TAG DPF
In build.gradle
the module not the project
buildTypes { release { ... buildConfigField "String", "TAG","\"DPF"\"" } debug { ... buildConfigField "String", "TAG", "\"DPF\"" } }
BuildConfig
in the Java (generated) folder.public static final String TAG = "DPF";
BuildConfig.TAG
wherever you want to use the constant