Volley HTTP库系列教程(1)简介及优点
Transmitting Network Data Using Volley
1.Dependencies and prerequisites
- Android 1.6 (API Level 4) or higher
VIDEO
Volley: Easy, Fast Networking for Android
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 DownloadManager
.
The core Volley library is developed in the open AOSP repository at frameworks/volley
and 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
- 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
.jar
file.
2.Lessons
- Sending a Simple Request
- Learn how to send a simple request using the default behaviors of Volley, and how to cancel a request.
- Setting Up a RequestQueue
- Learn how to set up a
RequestQueue
, and how to implement a singleton pattern to create aRequestQueue
that lasts the lifetime of your app. - Making a Standard Request
- Learn how to send a request using one of Volley's out-of-the-box request types (raw strings, images, and JSON).
- Implementing a Custom Request
- Learn how to implement a custom request.
Volley HTTP库系列教程(1)简介及优点的更多相关文章
- Volley HTTP库系列教程(4)Volley内置的几种请求介绍及示例,StringRequest,ImageRequest,JsonObjectRequest
Making a Standard Request Previous Next This lesson teaches you to Request a String 返回String Requ ...
- Volley HTTP库系列教程(5)自定义一个Volley请求
Implementing a Custom Request Previous Next This lesson teaches you to Write a Custom Request parse ...
- Volley HTTP库系列教程(3)自定义RequestQueue和编写单例RequestQueue示例
Setting Up a RequestQueue Previous Next This lesson teaches you to Set Up a Network and Cache Use a ...
- Volley HTTP库系列教程(2)Volley.newRequestQueue示例,发请求的流程,取消请求
Sending a Simple Request Previous Next This lesson teaches you to Add the INTERNET Permission Use n ...
- Android视频录制从不入门到入门系列教程(一)————简介
一.WHY Android SDK提供了MediaRecorder帮助开发者进行视频的录制,不过这个类很鸡肋,实际项目中应该很少用到它,最大的原因我觉得莫过于其输出的视频分辨率太有限了,满足不了项目的 ...
- Docker深入浅出系列教程——Docker简介
我是架构师张飞洪,钻进浩瀚代码,十年有余,人不堪其累,吾不改其乐.如果你和我的看法不一样,请关注我的头条号,我们一起奇闻共赏,疑义相析. 本节属于入门简介,从三个小方面进行简单介绍Docker. Do ...
- Cobaltstrike系列教程(一)-简介与安装
0x001-Cobaltstrike简介 Cobalt Strike是一款美国Red Team开发的渗透测试神器,常被业界人称为CS.这款神器许多大佬们都已经玩的很6,我一个菜鸡玩的略有心得,因此写一 ...
- Python系列教程(一):简介
Python发展历史 起源 Python的作者,Guido von Rossum,荷兰人.1982年,Guido从阿姆斯特丹大学获得了数学和计算机硕士学位.然而,尽管他算得上是一位数学家,但他更加享受 ...
- CSS3系列教程:HSL 和HSL
使用CSS3 HSL声明同样是用来设置颜色的.下一个呢? HSLA? 是的,这个和RGBA的效果是一样的. HSL声明使用色调Hue(H).饱和度Saturation(s)和亮度Lightness(L ...
随机推荐
- shell编程之echo命令
Linux echo命令不能显示文件中的内容.显示字符串或者变量功能说明:显示文字.语 法:echo [-ne][字符串]或 echo [--help][--version]补充说明:echo会将输入 ...
- DepthClipEnable error
刚刚呢又遇到这种鬼扯的问题,ps就return个(1,1,0,1) nisight的汇编都写对了,但结果就是画不出任何东西,按照经验,必然是某个state.... 我就找啊找啊,被我找到一个 Rast ...
- VSS
A deleted file of the same name already exists in this VSS project. Do you want to recover the delet ...
- 使用 Microsoft Word 发布博客文章
以 Microsoft Word 2010 为例: 依次选择:文件 -> 保存并发送 -> 发布为博客文章 配置说明:新建账户 的 博客文章 URL 一栏填写 http://rpc.cn ...
- SQL分页查询总结{转}
开发过程中经常遇到分页的需求,今天在此总结一下吧.简单说来方法有两种,一种在源上控制,一种在端上控制.源上控制把分页逻辑放在SQL层:端上控制一次性获取所有数据,把分页逻辑放在UI上(如GridVie ...
- Sqli-labs less 64
Less-64 此处的sql语句为 $sql="SELECT * FROM security.users WHERE id=(($id)) LIMIT 0,1"; 示例payloa ...
- 新浪SAE中文分词接口
最近发现新浪SAE平台上竟然也提供分词功能,分词效果也还不错,由新浪爱问提供的分词服务,研究了一番,做了一个简易版的在线调用接口(get方式,非post) 官网说明:http://apidoc.sin ...
- 解决JS文件页面加载时的阻塞
关于页面加载时的时间消费,许多书中都做出了介绍,也提出了很多种方法.本文章就详细介绍XHR注入. 概述:JS分拆的方法 1.XHR注入:就是用ajax异步请求同域包含脚本的文件,然后将返回的字符串转化 ...
- FZU2165 v11(带权的重复覆盖)
题意:有n个boss,m种武器,每种武器选用的时候需要有一定的花费ci,然后这个武器可以消灭掉其中一些BOSS,问你消灭完所有的BOSS,需要的最少花费是多少. 当时比赛的时候,看到这题以为是什么网络 ...
- 【QT】找茬外挂制作
找茬外挂制作 找茬游戏大家肯定都很熟悉吧,两张类似的图片,找里面的不同.在下眼神不大好,经常瞪图片半天也找不到区别.于是乎决定做个辅助工具来解放一下自己的双眼. 一.使用工具 Qt:主要是用来做界面的 ...