AndroidAPIService:ANDROID客户端访问RESTfulAPI,并对结果JSON进行正确解析的demo

上传者: 42099814 | 上传时间: 2023-02-18 07:33:42 | 文件大小: 1.57MB | 文件类型: ZIP
AndroidAPIService ##前言 目前移动端去访问服务器的方式,除了比较古老的WebService方式,还有一种就是利用RESTfulAPI 使用RESTfulAPI可以大大减低与服务器交互的复杂程度,这里本人做了一点小demo,供测试与服务器的数据交互问题的,如果有什么问题,希望大家能及时告知。 ##如何访问服务器 通过httpClient对RESTfulAPI进行访问,这里需要注意的是参数和中文编码问题; httpClient.getParams().setContentCharset("UTF-8"); 以及如何填充参数,这里针对get和post方法分成两种填充方式,一种就是作为queryString,另外一种就是常见的NameValuePair。 ##结果集封装 结果集用泛型进行封装,可以接受来自服务器的任何数据类型,但是前提是客户端和服务器需要统一数据模型。 ##Js

文件下载

资源详情

[{"title":"( 25 个子文件 1.57MB ) AndroidAPIService:ANDROID客户端访问RESTfulAPI,并对结果JSON进行正确解析的demo","children":[{"title":"AndroidAPIService-master","children":[{"title":"src","children":[{"title":"com","children":[{"title":"shenj","children":[{"title":"teworksandroid","children":[{"title":"http","children":[{"title":"common","children":[{"title":"ResultInfo.java <span style='color:#111;'> 825B </span>","children":null,"spread":false},{"title":"JsonBinder.java <span style='color:#111;'> 1.55KB </span>","children":null,"spread":false},{"title":"HttpAPIUtil.java <span style='color:#111;'> 982B </span>","children":null,"spread":false},{"title":"SJHttpRequestPostMethod.java <span style='color:#111;'> 1.36KB </span>","children":null,"spread":false},{"title":"SJHttpRequest.java <span style='color:#111;'> 3.72KB </span>","children":null,"spread":false},{"title":"SJHttpRequestGetMethod.java <span style='color:#111;'> 1.41KB </span>","children":null,"spread":false}],"spread":true}],"spread":true}],"spread":true}],"spread":true}],"spread":true}],"spread":true},{"title":".classpath <span style='color:#111;'> 832B </span>","children":null,"spread":false},{"title":"build","children":[{"title":"classes","children":[{"title":"com","children":[{"title":"shenj","children":[{"title":"teworksandroid","children":[{"title":"http","children":[{"title":"common","children":[{"title":"SJHttpRequest.class <span style='color:#111;'> 6.07KB </span>","children":null,"spread":false},{"title":"ResultInfo.class <span style='color:#111;'> 1.58KB </span>","children":null,"spread":false},{"title":"JsonBinder.class <span style='color:#111;'> 2.02KB </span>","children":null,"spread":false},{"title":"SJHttpRequestGetMethod.class <span style='color:#111;'> 2.92KB </span>","children":null,"spread":false},{"title":"HttpAPIUtil.class <span style='color:#111;'> 1.31KB </span>","children":null,"spread":false},{"title":"SJHttpRequestPostMethod.class <span style='color:#111;'> 2.54KB </span>","children":null,"spread":false}],"spread":true}],"spread":true}],"spread":true}],"spread":true}],"spread":true}],"spread":true}],"spread":true},{"title":".settings","children":[{"title":"org.eclipse.wst.common.project.facet.core.xml <span style='color:#111;'> 118B </span>","children":null,"spread":false},{"title":"org.eclipse.core.resources.prefs <span style='color:#111;'> 49B </span>","children":null,"spread":false},{"title":"org.eclipse.jdt.core.prefs <span style='color:#111;'> 357B </span>","children":null,"spread":false}],"spread":true},{"title":"libs","children":[{"title":"data.jar <span style='color:#111;'> 226.29KB </span>","children":null,"spread":false},{"title":"commons-httpclient-3.1.jar <span style='color:#111;'> 297.85KB </span>","children":null,"spread":false},{"title":"commons-logging-1.1.3.jar <span style='color:#111;'> 60.60KB </span>","children":null,"spread":false},{"title":"commons-codec-1.6.jar <span style='color:#111;'> 227.32KB </span>","children":null,"spread":false},{"title":"jackson-mapper-asl-1.9.13.jar <span style='color:#111;'> 762.37KB </span>","children":null,"spread":false},{"title":"jackson-core-asl-1.9.13.jar <span style='color:#111;'> 226.80KB </span>","children":null,"spread":false}],"spread":true},{"title":"README.md <span style='color:#111;'> 1.07KB </span>","children":null,"spread":false},{"title":".project <span style='color:#111;'> 580B </span>","children":null,"spread":false},{"title":".gitattributes <span style='color:#111;'> 378B </span>","children":null,"spread":false}],"spread":true}],"spread":true}]

评论信息

免责申明

【只为小站】的资源来自网友分享,仅供学习研究,请务必在下载后24小时内给予删除,不得用于其他任何用途,否则后果自负。基于互联网的特殊性,【只为小站】 无法对用户传输的作品、信息、内容的权属或合法性、合规性、真实性、科学性、完整权、有效性等进行实质审查;无论 【只为小站】 经营者是否已进行审查,用户均应自行承担因其传输的作品、信息、内容而可能或已经产生的侵权或权属纠纷等法律责任。
本站所有资源不代表本站的观点或立场,基于网友分享,根据中国法律《信息网络传播权保护条例》第二十二条之规定,若资源存在侵权或相关问题请联系本站客服人员,zhiweidada#qq.com,请把#换成@,本站将给予最大的支持与配合,做到及时反馈和处理。关于更多版权及免责申明参见 版权及免责申明