Skip to content

Instantly share code, notes, and snippets.

@mitchtabian
Created March 27, 2019 01:39
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 mitchtabian/665cc0c3b8a3f606d5f5825d716e202e to your computer and use it in GitHub Desktop.
Save mitchtabian/665cc0c3b8a3f606d5f5825d716e202e to your computer and use it in GitHub Desktop.
public class ServiceGenerator {
public static final String BASE_URL = "https://jsonplaceholder.typicode.com";
private static Retrofit.Builder retrofitBuilder =
new Retrofit.Builder()
.baseUrl(BASE_URL)
.addCallAdapterFactory(RxJava2CallAdapterFactory.create())
.addConverterFactory(GsonConverterFactory.create());
private static Retrofit retrofit = retrofitBuilder.build();
private static RequestApi requestApi = retrofit.create(RequestApi.class);
public static RequestApi getRequestApi(){
return requestApi;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment