Gson provideGson() {
return new Gson();
}
@Provides @Singleton Client provideClient() {
return new OkClient();
}
@Provides @Singleton RestAdapter provideRestAdapter(Gson gson,
Client client) {
return new RestAdapter.Builder()
.setConverter(new GsonConverter(gson))
.setClient(client)
.build();
}
@Provides @Singleton MyService provideMyService(RestAdapter restAdapter) {
return restAdapter.create(MyService.class);
}
}