Created
December 24, 2017 16:23
-
-
Save prakashpun/457364c454457cd3cb54b59c696cb18e to your computer and use it in GitHub Desktop.
RetrofitClientInstance.java
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
public class RetrofitClientInstance { | |
private static Retrofit retrofit; | |
private static final String BASE_URL = "https://jsonplaceholder.typicode.com"; | |
public static Retrofit getRetrofitInstance() { | |
if (retrofit == null) { | |
retrofit = new retrofit2.Retrofit.Builder() | |
.baseUrl(BASE_URL) | |
.addConverterFactory(GsonConverterFactory.create()) | |
.build(); | |
} | |
return retrofit; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment