JSON的使用
时间:2014-05-26 03:45:00
收藏:0
阅读:260
服务器端:
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"));
评论(0)