Volley is an HTTP library that makes it easier and faster for Android applications to transfer their network operations. The volley code is a project hosted under the Android source tree and is compiled with a Volley.jar file. Here are the features of volley
- Automatic dispatch of Network requests (HTTP) submitted in code
- Concurrent execution of multiple network requests
- Caching mechanism for user-transparent disk or memory (essentially HTTP caching mechanism)
- The ability to support network request prioritization
- You can cancel network requests that specify tags, or network requests that are categorized by some mechanism, by simply canceling the Web request (such as when the activity is destroyed), if necessary, in the code.
- Can make it easier for programmers to customize their request management, such as multiple attempts, failure handling, etc.
- A powerful sequencing mechanism that can easily and accurately update UI controls with data that is asynchronously requested
- Very easy to debug
Volley is very good at using a cross-threading approach to updating the UI interface, as well as being able to parse back json, images, strings, and so on. Things like parsing JSON strings are internally integrated, and you don't have to write specific code to do it, you just have to focus on the code logic of your app.
Volley not suitable for large file download and video streaming, because volley in the resolution of the network data return is done in memory, as for the download of large files, it is best to consider the implementation of Downloadmanager.
Volley source code is stored here, you can use Git clone directly to get:
git clone Https://android.googlesource.com/platform/frameworks/volley
When the "Ant Jar" command is completed in the downloaded code directory, the Volley.jar package is generated, so you can apply it in Eclipse or Android studio.
More convenient to use than HttpClient and URLConnection, is a high-level usage, beginners still want to write httpclient and URLConnection code, to understand how to use.
Introduction of Network Request library volley in Android app