Search in sources :

Example 1 with RxJavaCallAdapterFactory

use of retrofit2.adapter.rxjava.RxJavaCallAdapterFactory in project RxJavaSamples by rengwuxian.

the class Network method getGankApi.

public static GankApi getGankApi() {
    if (gankApi == null) {
        Retrofit retrofit = new Retrofit.Builder().client(okHttpClient).baseUrl("http://gank.io/api/").addConverterFactory(gsonConverterFactory).addCallAdapterFactory(rxJavaCallAdapterFactory).build();
        gankApi = retrofit.create(GankApi.class);
    }
    return gankApi;
}
Also used : Retrofit(retrofit2.Retrofit) GankApi(com.rengwuxian.rxjavasamples.network.api.GankApi)

Example 2 with RxJavaCallAdapterFactory

use of retrofit2.adapter.rxjava.RxJavaCallAdapterFactory in project RxJavaSamples by rengwuxian.

the class Network method getZhuangbiApi.

public static ZhuangbiApi getZhuangbiApi() {
    if (zhuangbiApi == null) {
        Retrofit retrofit = new Retrofit.Builder().client(okHttpClient).baseUrl("http://www.zhuangbi.info/").addConverterFactory(gsonConverterFactory).addCallAdapterFactory(rxJavaCallAdapterFactory).build();
        zhuangbiApi = retrofit.create(ZhuangbiApi.class);
    }
    return zhuangbiApi;
}
Also used : Retrofit(retrofit2.Retrofit) ZhuangbiApi(com.rengwuxian.rxjavasamples.network.api.ZhuangbiApi)

Aggregations

Retrofit (retrofit2.Retrofit)2 GankApi (com.rengwuxian.rxjavasamples.network.api.GankApi)1 ZhuangbiApi (com.rengwuxian.rxjavasamples.network.api.ZhuangbiApi)1