Advertisement
abuzuhair

ApiClient

Dec 15th, 2017
155
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.56 KB | None | 0 0
  1. package id.co.rumahcoding.neardeal;
  2.  
  3. import retrofit2.Retrofit;
  4. import retrofit2.converter.gson.GsonConverterFactory;
  5.  
  6. public class ApiClient {
  7.     public static final String BASE_URL ="http://192.168.1.23";
  8.     private static Retrofit retrofit = null;
  9.  
  10.     public static Retrofit getClient(){
  11.         if(retrofit == null) {
  12.             retrofit= new Retrofit.Builder()
  13.                     .baseUrl(BASE_URL)
  14.                     .addConverterFactory(GsonConverterFactory.create())
  15.                     .build();
  16.         }
  17.  
  18.         return retrofit;
  19.     }
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement