I am using Volley library in android.I run the same url in the browser and it returns in less than a second.I would like to know , how can optimize Volley? Not clear on what is
Try To use this Enhanced-volley
This project is based on the Volley Networking Toolkit for Android created by Google themselves. The toolkit itself is really great and extensible, but it is missing a few features. This project aims to add those features to the Volley toolkit to make it a more complete HTTP solution.
Also you can custom libs which uses Java NIO(new IO) to improve callback/response time. using Socket.IO
Some people also trying to use volley with OKHTTP
Thanks to Mr.Vinay
I had a similar kind of situation. I didn't notice the time delays as you did, but it was showing up in the browser and not in my app. Essentially, clearing the cache helped me out.
You can clear the cache by:
Requestqueue.getcache().clear();
If you want to disable the caching for jsonrequest
s, you can do that by:
jsonrequest.setshouldcache(false)
This had solved my problem of the caching.
I just answered this here : How to optimize network-queue-take in android Volley? (Volley Google IO 2013)
logSlowRequests just logs requests that are slow (over 3000ms), nothing more complicated there. network-http-complete is how long it takes to download the request and pass it off to the parser.