-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added Volley stetho network #51
Conversation
I think there's a much easier way to do this by subclassing the two HttpStack implementations or maybe even easier by just creating a StethoWrappingHttpStack. Also, prefer using Volley through Maven coordinates. We don't currently bundle any jar files. |
Extending HurlStack might be possible. That private static entityFromConnection might prove painful when trying to read the inputstream. |
As I think about this more, I think wrapping HttpStack is more flexible and simpler. This can be done by replacing the entity like: public HttpResponse performRequest(...) {
mNetworkEventReporter.requestWillBeSent(new VolleyInspectorRequest(request));
response = mDelegate.performRequest(request);
mNetworkEventReporter.receivedResponseHeaders(...);
InputStream intercepted = mNetworkEventReporter.interpretResponseStream(...);
response.setEntity(new InputStreamEntity(intercepted));
return response;
} This should make it possible to do: new StethoInterceptingHttpStack(new HurlStack(...)); The critical assumption with this approach is that |
Just saw #43 which might be of interest to you as well. This is a slightly different take on the solution if you use OkHttp. |
Yea, I just think this is the only connection agnostic method to integrating with volley. Still allows you to use OkHttp or UrlConnection or HttpClient under the hood. This sits on the layer right above that. |
@briangriffey agreed, I think the |
Any update? I'd really love to have good Volley support for Stetho... |
Sorry, end of the quarter is happening. I'll circle back to this beginning of April. |
👀 |
Any update on that pull request? |
brian@briangriffey.com |
Any news on this one? It is possible to use Stetho with Volley? |
@vaurdan yes it's always been possible to use Stetho with Volley it just requires you jump through some hoops. The easiest way is to use OkHttp with Volley and install this implementation into Volley: https://gist.github.com/bryanstern/4e8f1cb5a8e14c202750 This works great actually, it's just not as discoverable/convenient as we'd like. It also doesn't work if you use Volley with HttpURLConnection :\ |
@jasta Oh! Thanks for the tip, I've now Stetho working with Volley using the OkHttp! 👍 |
With stetho-volley, NullPointerException occurs when the response code is 204. Applying the patch below is required. |
Thanks to (http://www.littlerobots.nl/blog/stetho-for-android-debug-builds-only/ )[http://www.littlerobots.nl/blog/stetho-for-android-debug-builds-only/ ].I've now Stetho working with Volley using the OkHttp in my debug build, but using Volley alone in release! 👍 |
Ancient pull request and really isn't everyone just using OkHttp now? :) |
No description provided.