Last active
January 2, 2018 23:09
-
-
Save igor-brishkoski/68deeab53501dd80f98fbd06cac6c008 to your computer and use it in GitHub Desktop.
Store them in one place
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//build.gradle | |
android{ | |
... | |
productFlavors{ | |
staging{ | |
//use in java code | |
buildConfigField "String", "SERVICE_THAT_I_NEED", "s3cr3t_k3y_f0r_hackz0rz_staging" | |
buildConfigField "String", "MY_BACKEND_URL", "https://www.staging-example.com/api" | |
//use in xml, like AndroidManifest.xml | |
resValue "string", "google_maps_key", "5435651423234" | |
} | |
production{ | |
//use in java code | |
buildConfigField "String", "SERVICE_THAT_I_NEED", "s3cr3t_k3y_f0r_hackz0rz_production" | |
buildConfigField "String", "MY_BACKEND_URL", "https://www.production-example.com/api" | |
//use in xml, like AndroidManifest.xml | |
resValue "string", "google_maps_key", "5435651423234" | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment