设为首页 加入收藏

TOP

继续封装个 Volley 组件(二)
2019-09-01 23:26:37 】 浏览:61
Tags:继续 封装 Volley 组件
dTo(new File("/mnt/sdcard/abcd.png"), new VolleyListener<String>() { @Override public void onSuccess(String data) { Log.e("!!!!!", "asImageFile: " + data); } @Override public void onError(int code, String description) { Log.e("!!!!!", "asImageFile: " + description); } }); //设置通用的请求参数或请求头 DVolley.enterGlobalConfig() .globalParam("t", String.valueOf(System.currentTimeMillis())) .globalHeader("os", "android");

Github地址

DVolley组件:https://github.com/woshidasusu/base-module/tree/master/volley

组件有如下两个依赖库:

compile 'com.android.volley:volley:1.1.1'
compile 'com.google.code.gson:gson:2.7'

支持以下功能:

  • get 请求
  • post 请求
  • 图片下载在本地指定目录
  • 自动根据泛型解析 json
  • 取消指定请求
  • 设置通用请求参数或请求头

大家好,我是 dasu,欢迎关注我的公众号(dasuAndroidTv),如果你觉得本篇内容有帮助到你,可以转载但记得要关注,要标明原文哦,谢谢支持~
dasuAndroidTv2.png

首页 上一页 1 2 下一页 尾页 2/2/2
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
上一篇Android开发利器之Data Binding C.. 下一篇Kotlin入门(27)文件读写操作

最新文章

热门文章

Hot 文章

Python

C 语言

C++基础

大数据基础

linux编程基础

C/C++面试题目