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
205
votes
9 answers

Change Volley timeout duration

I use the new Volley framework for Android to do a request to my server. But it timeouts before getting the response, although it does respond. I tried adding this code: HttpConnectionParams.setConnectionTimeout(httpParams,…
Cissmayazz
  • 2,195
  • 3
  • 15
  • 10
180
votes
13 answers

java.lang.IllegalStateException: Fragment not attached to Activity

I am rarely getting this error while making an API call. java.lang.IllegalStateException: Fragment not attached to Activity I tried putting the code inside isAdded() method to check whether fragment is currently added to its activity but still i…
141
votes
8 answers

Can I do a synchronous request with volley?

Imagine I'm in a Service that already has a background thread. Can I do a request using volley in that same thread, so that callbacks happen synchronously? There are 2 reasons for this: First, I do not need another thread and it would be a waste to…
LocoMike
  • 5,626
  • 5
  • 30
  • 43
121
votes
19 answers

Volley Android Networking Library

I have few questions around using Volley in my projects: Can this library be used in any Java project or just Android? I see multiple branches here and no documentation on which branch is to start with. Which branch should I use to start with? How…
bianca
  • 7,004
  • 12
  • 43
  • 58
117
votes
11 answers

Error: Configuration with name 'default' not found in Android Studio

I am using the volley library to perform network operation in android. So I am trying to add this library in my project which is created in Android Studio and gradle system. I added the volley library in my project but when I sync with gradle then…
Bot
  • 2,285
  • 3
  • 17
  • 20
116
votes
13 answers

How to set custom header in Volley Request

How can custom headers be set for a Volley request? At the moment, there is way to set body content for a POST request. I've a simple GET request, but I need to pass the custom headers alongwith. I don't see how JsonRequest class supports it. Is it…
bianca
  • 7,004
  • 12
  • 43
  • 58
113
votes
6 answers

Working POST Multipart Request with Volley and without HttpEntity

This is not really a question, however, I would like to share some of my working code here for your reference when you need. As we know that HttpEntity is deprecated from API22 and comletely removed since API23. At the moment, we cannot access…
BNK
  • 23,994
  • 8
  • 77
  • 87
94
votes
9 answers

How to send a “multipart/form-data” POST in Android with Volley

Has anyone been able to accomplish sending a multipart/form-data POST in Android with Volley yet? I have had no success trying to upload an image/png using a POST request to our server and am curious if anyone has. I believe the default way to do…
AllDayAmazing
  • 2,383
  • 1
  • 24
  • 25
91
votes
18 answers

Import Android volley to Android Studio

I wanna use the google's volley library I am using Android Studio and I know how to add .jar libraries. But I could not create a .jar library with the volley files: https://android.googlesource.com/platform/frameworks/volley Here what I did:…
nsvir
  • 8,781
  • 10
  • 32
  • 47
88
votes
7 answers

Send POST request with JSON data using Volley

I would like to send a new JsonObjectRequest request: I want to receive JSON data (response from server): OK I want to send JSON formatted data with this request to the server JsonObjectRequest request = new JsonObjectRequest( …
anthony
  • 7,653
  • 8
  • 49
  • 101
88
votes
8 answers

Volley - POST/GET parameters

I saw Google IO 2013 session about Volley and I'm considering switching to volley. Does Volley support adding POST/GET parameters to request? If yes, how can I do it?
Ziem
  • 6,579
  • 8
  • 53
  • 86
83
votes
9 answers

Volley JsonObjectRequest Post request not working

I am using android Volley for making a request. So I use this code. I don't understand one thing. I check in my server that params is always null. I consider that getParams() not working. What should I do to solve this issue. RequestQueue queue =…
pmb
  • 2,327
  • 3
  • 30
  • 47
82
votes
9 answers

Best way to incorporate Volley (or other library) into Android Studio project

I've seen different advice on the best way to do this This question covers creating a jar. Elsewhere, I've seen advice to simply copy the volley source into your own project. This section on libraries at android.com would seem the most…
user3185563
  • 1,314
  • 2
  • 15
  • 22
75
votes
7 answers

Pull to refresh recyclerview android

Hi I've a tabbed activity, and in the first tab I fetch data from server and show it in a recyclerview within card views. For fetching the data from server I use the volley library. I want to implement the Pull to refresh to load the data (so…
75
votes
8 answers

How do you use the Android Volley API?

I am thinking of implementing the Android Volley library in my next projects (Google IO presentation about Volley). However, I haven't found any serious API for that library. How do I upload files, do POST/GET requests, and add a Gson parser as a…
user1940676
  • 4,348
  • 9
  • 44
  • 73
1
2 3
99 100