Skip to content

Instantly share code, notes, and snippets.

@igor-brishkoski
Last active January 2, 2018 23:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save igor-brishkoski/bf979c01c4a1dea13df641072ca12fa7 to your computer and use it in GitHub Desktop.
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
// 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