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
27
votes
3 answers

Throwing OutOfMemoryError "pthread_create (1040KB stack) failed: Try again" when doing asynchronous posts using Volley

I'm using Volley to POST some data stored in a local database to a server. The problem is when I have a big number of entries (for example 500) I get this error: java.lang.OutOfMemoryError: pthread_create (1040KB stack) failed: Try again at…
android enthusiast
  • 2,062
  • 2
  • 24
  • 45
27
votes
2 answers

Android Volley - How to isolate requests in another class

Hi I'd like to modularize the volley requests so I don't mix activity presentation code with volley requests. All samples I saw, the volley request are being placed -for example- on the OnClick event from an activity button. I mean this code(taken…
marianolp
  • 394
  • 1
  • 4
  • 9
27
votes
5 answers

Send post request using Volley and receive in PHP

I am trying to use volley in my project to handle all my HTTP request since it's the most efficient one as far as I know. So I started to learn volley by following this AndroidHive tutorial. My first GET request was successful. Then I moved on to…
ik024
  • 3,566
  • 7
  • 38
  • 61
26
votes
6 answers

How to send Authorization header in Android using Volley library?

How can I send Authorization header using Volley library in Android for GET method? This is my request code: JsonObjectRequest req = new JsonObjectRequest(Request.Method.GET, url, null, new Response.Listener() { …
Velpukonda Ramesh
  • 306
  • 1
  • 4
  • 14
26
votes
4 answers

Get HTTP status code for successful requests with Volley

I'm retrieving the content of a invalid web address with volley, i.e. http://www.gigd32fdsu.com: This is my test code: // Instantiate the RequestQueue. RequestQueue queue = Volley.newRequestQueue(this); final String url =…
Addev
  • 31,819
  • 51
  • 183
  • 302
26
votes
6 answers

Android Volley - Checking internet state

Before I am using Volley, well as usual, I used AsyncTask to check my internet state. Here is what I did in AsyncTask: private class NetCheck extends AsyncTask { @Override protected Boolean doInBackground(String...…
emen
  • 6,050
  • 11
  • 57
  • 94
25
votes
8 answers

NullPointerException addToRequestQueue(com.android.volley.Request, java.lang.String)' on a null object reference

I'm using AndroidHive register login and it's working fine in example project of this login-register. But after many attempts trying it with CardViews and other widgets, this error appears on the LogCat: java.lang.NullPointerException: Attempt to…
ʍѳђઽ૯ท
  • 16,646
  • 7
  • 53
  • 108
25
votes
4 answers

Android - Wait for volley response to return

I need execute a Volley request and wait for the response to parse it and return it, but have no idea on how to achieve this. Can someone help? What I have now is this: public String getLink() { JsonObjectRequest jsObjRequest = new…
JorgeR
  • 271
  • 1
  • 3
  • 6
24
votes
6 answers

Volley JSONException: End of input at character 0 of

I've seen others come across this problem, but none of the posts have been able to assist me. I'm attempting to use Volley for my REST call library, and when I'm attempting to use a Put call with a JSON Object as a parameter, I'm getting error with:…
Mike Walker
  • 2,944
  • 8
  • 30
  • 62
23
votes
2 answers

Rxjava and Volley Requests

My question should sounds something like stupid, but i am just jumping from Asynktask to RxJava. So: Is possible to use RxJava Observable with Volley Requests?, it means, using future requests. I ask this, because another httpClient like retrofit…
Max Pinto
  • 1,463
  • 3
  • 16
  • 29
23
votes
9 answers

Cancel All Volley Requests Android

At the moment i´m using mRequestQueue.cancelAll(getActivity()) at on stop method in a fragment but apparently when i move the phone from landscape to portrait it is still returning the data made in the request but causing crash because the holders…
geekkoz
  • 3,654
  • 4
  • 21
  • 19
22
votes
6 answers

Apache HTTP Client Removal from API23, will that have an effect on Volley?

As we have known that Apache HTTP Client removed in API 23 Apache HTTP Client Removal However, Volley library currently still uses Apache's library such as import org.apache.http.Header; import org.apache.http.HttpEntity; import…
BNK
  • 23,994
  • 8
  • 77
  • 87
22
votes
4 answers

Android Volley MalformedURLException Bad URL

After making a second network request using Volley, I always get this error. It doesn't seem to matter what the url I put in is. Volley always claims it is malformed. 08-04 20:16:26.885 14453-14470/com.thredup.android E/Volley﹕ [994]…
Eric Cochran
  • 8,414
  • 5
  • 50
  • 91
22
votes
12 answers

Android Volley gives me 400 error

I'm trying to make a POST request to my API and it works in Postman (I get a valid JSON object), but not using Volley. With the following code: String URL = "http://somename/token"; RequestQueue queue =…
Loolooii
  • 8,588
  • 14
  • 66
  • 90
22
votes
4 answers

Android Volley + Loader pattern?

I kinda liked Volley framework, but I still have some doubts about it. For example, how does Volley line up with Loader pattern? Since it's requests are handled in an async manner, calling it on background doesn't make much sense. On the other hand,…
husrevo
  • 331
  • 2
  • 6