I have implemented robospice in my project and using retrofit for all api calls. For some of requests, I need to increase timeout, please let me know how can I do that?
I don't know about robospice but with retrofit 2+ and okhttp3+ you should set a new client like this.
OkHttpClient okHttpClient = new OkHttpClient();
Retrofit retrofit = new Retrofit.Builder()
.baseUrl(Constantes.URL_DOMAIN)
.addConverterFactory(GsonConverterFactory.create())
.client(okHttpClient.newBuilder().connectTimeout(Constantes.TIMEOUT, TimeUnit.SECONDS).readTimeout(Constantes.TIMEOUT, TimeUnit.SECONDS).writeTimeout(Constantes.TIMEOUT, TimeUnit.SECONDS).build())
.build();
import this in your module build.gradle:
compile 'com.squareup.retrofit2:retrofit:2.0.0-beta3'
compile 'com.squareup.retrofit2:converter-gson:2.0.0-beta3'
compile 'com.squareup.okhttp3:okhttp:3.0.0-RC1'