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
39
votes
5 answers

Volley RequestQueue Timeout

RequestQueue mRequestQueue = Volley.newRequestQueue(getApplicationContext()); mRequestQueue.add(new JsonObjectRequest(Method.GET, cityListUrl, null, new Listener() { public void onResponse(JSONObject jsonResults) { …
Rizvan
  • 2,335
  • 2
  • 23
  • 42
38
votes
2 answers

Android set up Volley to use from cache

I'm trying to create and use a cache for a server JSON response. For example: cache JSON objects to internal memory and use that when we don't have an internet connection. In the following sample code, I can not find any document about how to…
user4790312
37
votes
8 answers

Glide - adding header to request

Is there a method to add a custom header to request when an image is downloaded? I can use volley or okhttp in Glide. I tried adding a cookie to the cookiemanager in okhttpclient, but it didn't help. Is there a method to debug request response in…
tomi
  • 381
  • 1
  • 3
  • 3
35
votes
8 answers

Android volley to handle redirect

I recently started to use Volley lib from Google for my network requests. One of my requests get error 301 for redirect, so my question is that can volley handle redirect somehow automatically or do I have to handle it manually in parseNetworkError…
Niko
  • 8,093
  • 5
  • 49
  • 85
35
votes
5 answers

Android Volley ImageLoader - BitmapLruCache parameter?

I am having trouble implementing Image cache using the new Volley library. In the presentation, code look like this mRequestQueue = Volley.newRequestQueue(context); mImageLoader = new ImageLoader(mRequestQueue, new BitmapLruCache()); The…
urSus
  • 12,492
  • 12
  • 69
  • 89
34
votes
3 answers

Disable Volley cache management

Is there a way I could disable the Volley cache management? My app is using Google Volley library to manage the transport layer, but I have my own cache manager implementation because the server does not uses Cache-Control header. I want to save the…
Juampa
  • 2,035
  • 2
  • 25
  • 35
34
votes
3 answers

Performance issue with Volley's DiskBasedCache

In my Photo Collage app for Android I'm using Volley for loading images. I'm using the DiskBasedCache (included with volley) with 50 mb storage to prevent re-downloading the same images multiple times. Last time I checked the DiskBasedCache…
Ludde
  • 527
  • 1
  • 6
  • 12
33
votes
4 answers

How to prevent Volley request from retrying?

I post a JsonRequest to a server. The server is slow and Volley tends to make multiple calls to the slow server because it didn't get a response from the first request (since my server is slow). Is there a way to prevent Volley from retrying a…
xiaowoo
  • 2,248
  • 7
  • 34
  • 45
32
votes
1 answer

Issues and contribution for Volley

Since there was this awesome presentation on Volley I tried to include it in a project I am working on. I found myself correcting some bugs I found in the source code that was published. Does anybody know if there is gonna be some GitHub project…
Mike T
  • 1,194
  • 14
  • 25
31
votes
2 answers

How to multipart data using Android Volley

I am using Volley for calling web request for my app. But as i am Volley for first time. I just want to know that how to upload image/video media data via volley using multipart. I searched for it many sites, I got some results over How to send a…
Ashok Singhal
  • 520
  • 1
  • 5
  • 10
30
votes
4 answers

How to access the contents of an error response in Volley?

Using any of these examples: http://developer.android.com/training/volley/request.html I understand how to process the response of a succesful request, and how to detect and react to an error. However, an error may be (among other situations) a 40x…
matteo
  • 2,934
  • 7
  • 44
  • 59
30
votes
7 answers

How to get finish callback on setImageUrl with Volley library and NetworkImageView?

I'm trying out the Google's new Volley library and it's looking sharp and loads images quickly when I use this method setImageUrl: holder.image.setImageUrl(url, ImageCacheManager.getInstance().getImageLoader()); I want to add to it a call…
Emil Adz
  • 40,709
  • 36
  • 140
  • 187
28
votes
6 answers

Android Studio:error: illegal character: '\u2028'

I am trying to do a JSONObject request: final String URL = "https://some/url"; // Post params to be sent to the server HashMap params = new HashMap(); params.put("param1", param1); 
params.put("param2",…
jublikon
  • 3,427
  • 10
  • 44
  • 82
28
votes
9 answers

Android Volley - BasicNetwork.performRequest: Unexpected response code 400

Problem statement: I am trying to access an REST API that will return a JSON object for various HTTP status codes (400, 403, 200 etc) using Volley. For any HTTP status other than 200, it seems the 'Unexpected response code 400' is a problem. Does…
clearstake
  • 507
  • 1
  • 5
  • 9
28
votes
3 answers

How does one use Basic Authentication with Volley on Android?

I'm looking through examples and code but I don't see anything implemented. Is this possible at this stage?
LocoMike
  • 5,626
  • 5
  • 30
  • 43