JSON的使用

来源:互联网 发布:抓包怎么看数据信息 编辑:程序博客网 时间:2024/05/22 06:58

服务器端:

Person person = new Person(  ,    ,);JSONObject obj = new JSONObject();obj.put("person", person);

Android 客户端:

JSONObject jsonObject = new JSONObject(jsonString);JSONObject personObject = jsonObject.getJSONObject("person");person.setId(personObject.getInt("id"));person.setName(personObject.getString("name"));



1 0
原创粉丝点击