SHARE
TWEET

Untitled

a guest Mar 24th, 2019 62 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import com.google.gson.GsonBuilder
  2. import retrofit.GsonConverterFactory
  3. import retrofit.Retrofit
  4. import retrofit.RxJavaCallAdapterFactory
  5.  
  6. object ApiClient {
  7.  
  8.     private const val BASE_URL = "https://www.thesportsdb.com/api/v1/json/1/"
  9.  
  10.     fun provideApi(): ApiService {
  11.         val gson = GsonBuilder().create()
  12.         return Retrofit.Builder()
  13.             .addCallAdapterFactory(RxJavaCallAdapterFactory.create())
  14.             .addConverterFactory(GsonConverterFactory.create(gson))
  15.             .baseUrl(BASE_URL)
  16.             .build()
  17.             .create(ApiService::class.java)
  18.     }
  19. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top