I am using Volley library in my android app. It works fine, but I saw that OkHttp provides some more improvements also. I have integrated the OkHttp with Volley using :
Volley.newRequestQueue(mCtx.getApplicationContext(), new OkHttpStack());
My OkHttpStack class is :
public class OkHttpStack extends HurlStack {
private final OkUrlFactory mFactory;
public OkHttpStack() {
this(new OkHttpClient());
}
public OkHttpStack(OkHttpClient client) {
if (client == null) {
throw new NullPointerException("Client must not be null.");
}
mFactory = new OkUrlFactory(client);
}
@Override protected HttpURLConnection createConnection(URL url) throws IOException {
return mFactory.open(url);
}
}
1) Is it worth it? I have not noticed any noticeable improvement, but that may be because I have still not implemented SPDY support on my server.
2) On of the enhancement by OkHttp is response caching. However, volley does that too. Will I have any issues similar to this: https://github.com/square/okhttp/issues/680
3) Also, I am using two RequestQueues in Volley - one for Images & other for JSON. Should I use OkHttp with both queues?