HttpUtils 请求数据(json)
来源:互联网 发布:淘宝网前任总裁 编辑:程序博客网 时间:2024/06/05 19:27
public void getData(int count,final int what){
String path="http://ic.snssdk.com/2/article/v25/stream/?category=video&count=20" +
"&min_behot_time=1465197958&bd_latitude=4.9E-324&bd_longitude=4.9E-324&bd_loc_time=1465265107&loc_mode=5&lac=4527&cid=28883&iid=4464422609&device_id=17258390367&ac=wifi&channel=baidu&aid=13&app_name=news_article&version_code=460&device_platform=android&device_type=SAMSUNG&os_api=" +
"19&os_version=4.4.4&uuid=353040417908000&openudid=84c1c7b192991cc6";
HttpUtils httpUtils = new HttpUtils();
httpUtils.configCurrentHttpCacheExpiry(0);
httpUtils.send(HttpMethod.GET, path, new RequestCallBack<String>() {
@Override
public void onFailure(HttpException arg0, String arg1) {
}
@Override
public void onSuccess(ResponseInfo<String> arg0) {
Gson gson=new Gson();
String json = arg0.result;
Bean bean = gson.fromJson(json, Bean.class);
Message msg=Message.obtain();
List<MyData> data = bean.data;
msg.obj=data;
msg.what=what;
han.sendMessage(msg);
}
});
}
String path="http://ic.snssdk.com/2/article/v25/stream/?category=video&count=20" +
"&min_behot_time=1465197958&bd_latitude=4.9E-324&bd_longitude=4.9E-324&bd_loc_time=1465265107&loc_mode=5&lac=4527&cid=28883&iid=4464422609&device_id=17258390367&ac=wifi&channel=baidu&aid=13&app_name=news_article&version_code=460&device_platform=android&device_type=SAMSUNG&os_api=" +
"19&os_version=4.4.4&uuid=353040417908000&openudid=84c1c7b192991cc6";
HttpUtils httpUtils = new HttpUtils();
httpUtils.configCurrentHttpCacheExpiry(0);
httpUtils.send(HttpMethod.GET, path, new RequestCallBack<String>() {
@Override
public void onFailure(HttpException arg0, String arg1) {
}
@Override
public void onSuccess(ResponseInfo<String> arg0) {
Gson gson=new Gson();
String json = arg0.result;
Bean bean = gson.fromJson(json, Bean.class);
Message msg=Message.obtain();
List<MyData> data = bean.data;
msg.obj=data;
msg.what=what;
han.sendMessage(msg);
}
});
}
0 0
- HttpUtils 请求数据(json)
- HttpUtils 请求数据(pull)
- HttpUtils请求数据
- HttpUtils请求数据
- httpUtils请求XML数据
- HttpUtils请求数据
- httputils请求数据
- 使用HttpUTILS请求XML数据
- Httputils请求数据Pull解析
- HttpUtils请求数据(返回上一层fragment)
- HttpUtils请求json加刷新加载
- HttpUtils请求
- HttpURLConnection、HttpClient请求网络数据、Xutils的HttpUtils 请求数据
- Pull解析xml文件,并用HttpUtils请求数据接口(示例方法)
- 通过httpUtils请求网络xml数据进行解析
- 用于解析Json数据的HttpUtils工具类
- Ion + HttpUtils 网络请求
- Xutils----httpUtils请求
- HttpUtils 请求数据(pull)
- 第134课: Spark Streaming总结
- git安装以及使用
- quick-cocos2dx lua里对class的定义
- Cordova项目的编译常用命令
- HttpUtils 请求数据(json)
- android蓝牙开发---与蓝牙模块进行通信
- GMap.Net开发之自定义Marker
- 关于设置应用的高度不受状态栏高度的影响
- Android性能优化总结
- xlistview的xml文件1
- C#项目中调用C++生成的Dll 入门教程
- 注册/开关控制
- java_net 网络聊天室及其问题解决