at retrofit2 defaultcalladapterfactory 24executorcallbackcall 241 onfailure 28defaultcalladapterfactory java 3a96 29

Solutions on MaxInterview for at retrofit2 defaultcalladapterfactory 24executorcallbackcall 241 onfailure 28defaultcalladapterfactory java 3a96 29 by the best coders in the world

showing results for - "at retrofit2 defaultcalladapterfactory 24executorcallbackcall 241 onfailure 28defaultcalladapterfactory java 3a96 29"
Jorge
30 Feb 2017
1class RetrofitService {
2
3    private val BASE_URL = "https://jsonplaceholder.typicode.com/"
4
5
6    private val loggingInterceptor = HttpLoggingInterceptor()
7
8
9    private val httpClient = OkHttpClient.Builder().addInterceptor(loggingInterceptor).build()
10
11    private val builder = Retrofit.Builder()
12        .baseUrl(BASE_URL)
13        .addConverterFactory(GsonConverterFactory.create())
14        .client(httpClient)
15
16    private val retrofit = builder.build()
17
18    init {
19        loggingInterceptor.level = HttpLoggingInterceptor.Level.BODY
20    }
21
22    fun <S> createService(
23        serviceClass: Class<S>
24    ): S {
25        return retrofit.create(serviceClass)
26    }
27}
Tommaso
02 Aug 2020
1android {
2    compileOptions {
3        targetCompatibility = "8"
4        sourceCompatibility = "8"
5    }
6}