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
BuildConfigin the Java (generated) folder. - You should see something like
public static final String TAG = "DPF"; - Now use
BuildConfig.TAGwherever you want to use the constant