Introduction of Network Request library volley in Android app

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.