OkHttp + Gson
来源:互联网 发布:淘宝网开店要交钱吗 编辑:程序博客网 时间:2024/05/22 17:40
OkHttpClient mClient = new OkHttpClient(); Request mRequest = new Request.Builder() .url("http://192.168.199.110:8080/mockjs/1/getLoadingSheetList?") .build(); mClient.newCall(mRequest).enqueue(new Callback() { @Override public void onFailure(Call call, IOException e) { } @Override public void onResponse(Call call, final Response response) throws IOException { Gson gson = new Gson(); String result = response.body().string(); Log.e("message", result); mJsonDriver = new JsonDriver(); mJsonDriver = gson.fromJson(result, JsonDriver.class); final int count = mJsonDriver.getCount(); Log.e("message2", String.valueOf(count)); final String endStation = mJsonDriver.getDataList().get(0).getEndStation(); Log.e("message2", endStation); runOnUiThread(new Runnable() { @Override public void run() { mTextView.setText(endStation); } }); } });
0 0
- OkHttp + Gson
- OkHttp和Gson
- Okhttp和Gson解析
- Volley+OkHttp+Gson自定义框架
- Rxjava+retrofit2+OKHttp+GSON实践
- 在okHttp里使用Gson解析 报错OKHttp Dispatcher
- 在安卓上使用RxJava Retrofit OKHttp GSON
- Android Networking I: OkHttp, Volley and Gson
- OKHttp与GSON获取JSON数据
- JSON,Gson,OkHttp,Handler的使用
- 重构(MVP+Retrofit+Okhttp+Gson+Butterknife)
- 使用Android API最佳实践 Retrofit OKHttp GSON
- 使用Android API最佳实践 Retrofit OKHttp GSON
- android网络操作I: OkHttp, Volley以及Gson
- 使用Volley+OkHttp+Gson加速Android网络开发
- (十)【续】网络框架篇(RxJava+OkHttp+Gson)
- 使用Android API最佳实践 Retrofit OKHttp GSON
- gson解析通过okhttp获取的json格式数据
- 简单的上下滚动
- mvp
- git向github上传完整项目
- 【bzoj3993】[SDOI2015]星际战争 二分+最大流
- 82. Remove Duplicates from Sorted List II
- OkHttp + Gson
- 黑科技:自定义百度云分享密码
- Android ListView item中有按钮(Button)不能点击或者条目不能点击的问题
- PHP并发IO编程之路
- Android dip/dp sp px 单位转换小结 applyDimension
- iOS9适配 之 关于info.plist 第三方登录 添加URL Schemes白名单
- “自释放”在iOS开发中的应用
- 209. Minimum Size Subarray Sum
- WMS系统开发环境及设计框架