use of org.michenux.drodrolib.network.okhttp.LoggingInterceptor in project YourAppIdea by Michenux.
the class MongolabPlaceServiceFactory method create.
public static MongolabPlaceService create(Context context) {
GsonBuilder gsonBuilder = new GsonBuilder();
gsonBuilder.registerTypeAdapter(Timestamp.class, new TimestampDeserializer());
gsonBuilder.registerTypeAdapter(Location.class, new LocationDeserializer());
OkHttpClient client = new OkHttpClient.Builder().addInterceptor(new LoggingInterceptor()).build();
String url = context.getString(R.string.aroundme_placeremoteprovider_url);
Retrofit retrofit = new Retrofit.Builder().baseUrl(url).client(client).addConverterFactory(GsonConverterFactory.create(gsonBuilder.create())).addCallAdapterFactory(RxJavaCallAdapterFactory.create()).build();
return retrofit.create(MongolabPlaceService.class);
}
use of org.michenux.drodrolib.network.okhttp.LoggingInterceptor in project YourAppIdea by Michenux.
the class AirportInfoServiceFactory method create.
public static AirportInfoService create(Context context) {
GsonBuilder gsonBuilder = new GsonBuilder();
gsonBuilder.registerTypeAdapter(Timestamp.class, new TimestampDeserializer());
gsonBuilder.registerTypeAdapter(Location.class, new LocationDeserializer());
OkHttpClient client = new OkHttpClient.Builder().addInterceptor(new LoggingInterceptor()).build();
Retrofit retrofit = new Retrofit.Builder().baseUrl(context.getString(R.string.airport_rest_url)).client(client).addConverterFactory(GsonConverterFactory.create(gsonBuilder.create())).addCallAdapterFactory(RxJavaCallAdapterFactory.create()).build();
return retrofit.create(AirportInfoService.class);
}
use of org.michenux.drodrolib.network.okhttp.LoggingInterceptor in project YourAppIdea by Michenux.
the class WordpressServiceFactory method create.
public static WordpressService create(Context context) {
GsonBuilder gsonBuilder = new GsonBuilder();
gsonBuilder.registerTypeAdapter(Timestamp.class, new TimestampDeserializer());
gsonBuilder.registerTypeAdapter(Location.class, new LocationDeserializer());
OkHttpClient client = new OkHttpClient.Builder().addInterceptor(new LoggingInterceptor()).build();
Retrofit retrofit = new Retrofit.Builder().baseUrl(context.getString(R.string.tutorial_sync_url)).client(client).addConverterFactory(GsonConverterFactory.create(gsonBuilder.create())).addCallAdapterFactory(RxJavaCallAdapterFactory.create()).build();
return retrofit.create(WordpressService.class);
}
Aggregations