对不起,我解释一下。我应该使用JSON转换哪个集合并再次解析?
我正在开发一个在Google App Engine上使用WebService的Android应用程序。 在我的WebService的我在JSON转换一个ArrayList槽JAX-RS,并最终JSON是一样的东西
{ “教训”:[{ “Name”: “布拉布拉”, “教授”:”汤姆”},{ “名”: “布拉布拉”, “教授”: “汤姆”}]}
这是实际的还是有更好的办法?
然后我取从Android应用此JSON,并将其转换在一个JSONObject与snipplet网上查到:
DefaultHttpClient defaultClient =新DefaultHttpClient();
HttpGet httpGetRequest = new HttpGet(s);
HttpResponse httpResponse = defaultClient.execute(httpGetRequest);
BufferedReader reader = new BufferedReader(new InputStreamReader(httpResponse.getEntity()。getContent(),“UTF-8”));
String json = reader.readLine(); JSONObject jsonObject = new JSONObject(json);}}}
如何返回到我的ArrayList?
我读过吨的代码,并试图用GSON ... 这应该是容易的,但在昨天,我已经失去了一整天的时间..
这就像一个魅力。非常感谢! – Enrichman 2012-04-20 03:11:17