Questions tagged [android-volley]

Volley is a Google library for Android that makes networking and remote image loading easier and faster.

Written by Ficus Kirkpatrick and his team, Volley is a library released by Google at I/O 2013. The Google Play Store and a number of apps by Google use this library to perform network requests and remote image loading. The developers at Google claim that network requests performed through Volley are up to 10 times faster than other libraries according to their tests. There is also an official documentation and a Github.

You can clone the GIT repository by running this command:

git clone https://android.googlesource.com/platform/frameworks/volley
6757 questions
18
votes
1 answer

Android Volley error.getMessage() is blank

So I am making a POST JSonObjectRequest to my server and when it is successful everything works and the info is posted, but if there is an error and I try to display it in a toast, it shows up as blank. Here is my request: private void logUserIn()…
mikebertiean
  • 3,611
  • 4
  • 20
  • 29
18
votes
12 answers

Volley not calling getParams() for standard POST request

I am trying to post some parameters to my rails API using Volley in Android. This is the code: I tried with two log statements, one in getParams() and another in getHeaders(). The one in getHeaders() is logged while the other one is not. Why is…
Varun Jain
  • 1,901
  • 7
  • 33
  • 66
18
votes
5 answers

Why does volley's response string use an encoding different from that in the response headers?

When doing a volley request (either StringRequest or JsonObjectRequest), using the OkHttp stack, the response string's encoding is set to ISO-8995-1, which is the default encoding. The response has a header: content-type=text/html; charset=utf-8,…
mjibson
  • 16,852
  • 8
  • 31
  • 42
17
votes
3 answers

How to put Cookie session id into volley request?

So, i have this code to make a POST request with volley: public class MainActivity extends AppCompatActivity { Button btnSearch; ProgressDialog loadingDialog; ListView lvResult; String session_id; RequestQueue queue; MyCookieManager…
PiLHA
  • 2,326
  • 1
  • 24
  • 32
17
votes
8 answers

How to get error message description using Volley

I'm sending an http request from Android Java using the Volley library to a c# backend. The backend application responds with a error code and description as intended, as well as a StatusDescription. I can see the response status description through…
GraphiteEdge
  • 173
  • 1
  • 1
  • 6
17
votes
6 answers

java.net.ProtocolException: unexpected end of stream

I am facing a strange issue, and I am not able to debug it out. I have implemented a logic for uploading stream of data and am using Volley for the same, I have customized a logic little bit in HurlStack, addBodyIfExists api,so that body of type…
Techfist
  • 4,314
  • 6
  • 22
  • 32
17
votes
3 answers

Android Offline Request with Volley

I want to give to my user a much better offline user experience, therefore, I want to build a Service which stores all POST, DELETE, PUT (GET makes no sense because a GET call without network is a cache call) requests the user does offline and send…
Laurent Meyer
  • 2,766
  • 3
  • 33
  • 57
17
votes
2 answers

Why is response time(for Rest Call) slower in Android when compared to PC?

I am making a rest api call from Android device and was really surprised looking at the difference of speeds when compared to PC. Below is the image from a rest tool on PC. I tried few libraries like Retrofit, Volley and also regular Async task to…
Prakash
  • 7,794
  • 4
  • 48
  • 44
17
votes
4 answers

Android - cancel Volley request

I am using Android Volley lib in my project to execute network requests, all works very well but I have some troubles with the "cancel" feature of this lib. I explain my issue.. I've an activity, where I'm executing the request at OnCreate method,…
ejay
  • 1,114
  • 3
  • 14
  • 26
17
votes
5 answers

SSL Pinning with Volley network library on Android

I want to use SSL Pinning in volley network library. Is there any way to implement SSL pinning with volley? Does volley provide this support for security improvements?
KAPLANDROID
  • 1,099
  • 1
  • 12
  • 23
17
votes
2 answers

How to make soap post request using Volley library in Android

I want make to make soap post request using Volley library. I am using the following code and got error "HTTP/1.1 400 Bad Request". In previous I am using Soap library working fine but I need to make request using Volley library.I am using…
Dayakar Reddy
  • 179
  • 1
  • 5
17
votes
1 answer

Make Volley request in different thread

I would like to make a request using the Android Volley library in a different thread. What I mean is, there is the connection which is in the thread and the data is processed in the UI thread. I want to do this because I have a lot of connections,…
Thomas Trabelsi
  • 330
  • 1
  • 8
  • 21
17
votes
3 answers

Android Volley makes 2 requests to the server when retry policy is set to 0

I'm working on an Android project that uses Volley for async requests and imagecaching. Somehow a request is hitting the server twice even when I have the retry policy set to 0. I tried overriding the values from the DefaultRetryPolicy object with…
17
votes
3 answers

Volley out of memory error, weird allocation attempt

Sometimes randomly Volley crashes my app upon startup, it crashes in the application class and a user would not be able to open the app again until they go into settings and clear app data java.lang.OutOfMemoryError at…
CQM
  • 42,592
  • 75
  • 224
  • 366
17
votes
4 answers

Handle an empty response in a JSONRequest with Volley

I'm using Volley to make a POST request in my application, and in my case, a good response is a 201 with an empty body. I'm using a JSONRequest, to make the call. My problem is that the error response handler is getting called because response is…
coder
  • 10,460
  • 17
  • 72
  • 125