This library includes three open source library code :
volley(Mirror https://github.com/mcxiaoke/android-volley) ,
okhttp(Mirror : https://github.com/square/okhttp),
okio(Mirror : https://github.com/square/okio).
modify volley source code for the cachekey of jsonRequest ,like this mark(@github.com/jarlen) in JsonRequest.java (origin:"Method + url" as cacheKey,now : "mehod + url + params" as cacheKey)
add MapRequest
OkHttpClient as the transport layer for Volley (@link https://gist.github.com/bryanstern/4e8f1cb5a8e14c202750)
private RequestQueue requestQueue = Volley.newRequestQueueWithOkHttp(this);
Add gzip response for volley response
GzipJsonObjectRequest objectRequest = new GzipJsonObjectRequest(?,?,?,?);
Modify newRequestQueue function for changing cache dir
private RequestQueue requestQueue = Volley.newRequestQueue(this, "mnt/sdcard/");
add request with gzip
这个库包括三个开源项目代码,Volley OkHttp,Gzip
主要修改了以下几点:
优化了JsonRequest请求缓存处理Key,原始使用Method + Url 的方式,不能标示唯一的网络请求数据缓存Key,现调整为Method + url + params as cachekey (个人理解这样)
添加了网络请求参数为Map的请求方式
引入OkHttpClient作为Volley的网络传输层,具体参考与:(https://gist.github.com/bryanstern/4e8f1cb5a8e14c202750)
private RequestQueue requestQueue = Volley.newRequestQueueWithOkHttp(this);
添加了网络请求返回数据Gzip数据解压处理。
GzipJsonObjectRequest objectRequest = new GzipJsonObjectRequest(?,?,?,?);
改变volley请求队列创建接口,可以自定义缓存路径
private RequestQueue requestQueue = Volley.newRequestQueue(this, "mnt/sdcard/")
添加实现可以gzip数据压缩请求
小弟不才,仅仅在原有开源库基础上做了一些调整,欢迎大家检视代码并指正,有兴趣的同学可以一起优化。
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。
1. 开源生态
2. 协作、人、软件
3. 评估模型