Transmitting Network Data Using Volley - Volley is an HTTP library that makes networking for Android
2015-02-28 17:21
686 查看
Volley is an HTTP library that makes networking for Android apps easier and most importantly, faster. Volley is available through the open AOSP repository.
Volley offers the following benefits:
Automatic scheduling of network requests.
Multiple concurrent network connections.
Transparent disk and memory response caching with standard HTTP cache coherence.
Support for request prioritization.
Cancellation request API. You can cancel a single request, or you can set blocks or scopes of requests to cancel.
Ease of customization, for example, for retry and backoff.
Strong ordering that makes it easy to correctly populate your UI with data fetched asynchronously from the network.
Debugging and tracing tools.
Volley excels at RPC-type operations used to populate a UI, such as fetching a page of search results as structured data. It integrates easily with any protocol and comes out of the box with support for raw strings,
images, and JSON. By providing built-in support for the features you need, Volley frees you from writing boilerplate code and allows you to concentrate on the logic that is specific to your app.
Volley is not suitable for large download or streaming operations, since Volley holds all responses in memory during parsing. For large download operations, consider using an alternative like
The core Volley library is developed in the open AOSP repository at
contains the main request dispatch pipeline as well as a set of commonly applicable utilities, available in the Volley "toolbox." The easiest way to add Volley to your project is to clone the Volley repository and set it as a library project:
Git clone the repository by typing the following at the command line:
Volley offers the following benefits:
Automatic scheduling of network requests.
Multiple concurrent network connections.
Transparent disk and memory response caching with standard HTTP cache coherence.
Support for request prioritization.
Cancellation request API. You can cancel a single request, or you can set blocks or scopes of requests to cancel.
Ease of customization, for example, for retry and backoff.
Strong ordering that makes it easy to correctly populate your UI with data fetched asynchronously from the network.
Debugging and tracing tools.
Volley excels at RPC-type operations used to populate a UI, such as fetching a page of search results as structured data. It integrates easily with any protocol and comes out of the box with support for raw strings,
images, and JSON. By providing built-in support for the features you need, Volley frees you from writing boilerplate code and allows you to concentrate on the logic that is specific to your app.
Volley is not suitable for large download or streaming operations, since Volley holds all responses in memory during parsing. For large download operations, consider using an alternative like
DownloadManager.
The core Volley library is developed in the open AOSP repository at
frameworks/volleyand
contains the main request dispatch pipeline as well as a set of commonly applicable utilities, available in the Volley "toolbox." The easiest way to add Volley to your project is to clone the Volley repository and set it as a library project:
Git clone the repository by typing the following at the command line:
git clone https://android.googlesource.com/platform/frameworks/volley[/code]
Import the downloaded source into your app project as an Android library project (as described in Managing
Projects from Eclipse with ADT, if you're using Eclipse) or make a.jarfile.Sending a Simple RequestLearn how to send a simple request using the default behaviors of Volley, and how to cancel a request.Setting Up a RequestQueueLearn how to set up a
LessonsRequestQueue, and how to implement a singleton pattern to create aRequestQueuethat
lasts the lifetime of your app.Making a Standard RequestLearn how to send a request using one of Volley's out-of-the-box request types (raw strings, images, and JSON).Implementing a Custom RequestLearn how to implement a custom request.
GET STARTED
相关文章推荐
- Android训练课程(Android Training) - 使用Volley传输网络数据(Transmitting Network Data Using Volley)
- Android训练课程(Android Training) - 使用Volley传输网络数据(Transmitting Network Data Using Volley)
- An Asynchronous HTTP Library for Android
- Android开发训练之第五章第七节——Transmitting Network Data Using Volley
- Transmitting Network Data Using Volley - Sending a Simple Request
- Transmitting Network Data Using Volley
- Transmitting Network Data Using Volley -Implementing a Custom Request
- http://www.asp.net/mvc/overview/getting-started/getting-started-with-ef-using-mvc/creating-an-entity-framework-data-model-for-an-asp-net-mvc-application
- 跟Google 学代码:Transmitting Network Data Using Volley
- Transmitting Network Data Using Volley 之Sending a Simple Request
- Transmitting Network Data Using Volley
- Transmitting Network Data Using Volley - Setting Up a RequestQueue
- Transmitting Network Data Using Volley(使用Volley框架传输网络数据)
- Transmitting Network Data Using Volley -Making a Standard Request
- Develop an Apache HttpClient client for Android to a JAX-RS web service
- android.view.WindowManager$BadTokenException: Unable to add window -- token null is not for an appli
- android.view.WindowManager$BadTokenException: Unable to add window -- token null is not for an appli
- android.view.WindowManager$BadTokenException: Unable to add window — token null is not for an applic
- GNU libmicrohttpd: a library for creating an embedded HTTP server
- android.view.WindowManager$BadTokenException: Unable to add window -- token null is not for an appli