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