Last active
January 2, 2018 23:08
-
-
Save igor-brishkoski/bf979c01c4a1dea13df641072ca12fa7 to your computer and use it in GitHub Desktop.
We can use the config variables from build.gradle in your java code
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
// java code | |
... | |
//init the service | |
return new ExpensiveServiceThatMyAppUses.Builder() | |
.initWithKey(BuildConfig.SERVICE_THAT_I_NEED); // use the value here | |
.someConfig(true) | |
.build(); | |
... | |
//init retrofit so that i can make http calls to my backend | |
return new Retrofit.Builder() | |
.addConverterFactory(GsonConverterFactory.create(gson)) | |
.baseUrl(BuildConfig.MY_BACKEND_URL) //use the value here | |
.client(okHttpClient) | |
.build(); | |
... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment