-1
A
回答
1
DefaultHttpClient client = new DefaultHttpClient();
String finalJson="";
HttpGet getRequest = new HttpGet(url);
try {
HttpResponse getResponse = client.execute(getRequest);
final int statusCode = getResponse.getStatusLine().getStatusCode();
if (statusCode != HttpStatus.SC_OK) {
Log.w(getClass().getSimpleName(), "Error " + statusCode + " for URL " + url);
return null;
}
HttpEntity getResponseEntity = getResponse.getEntity();
finalJson=EntityUtils.toString(getResponseEntity);
System.out.println("getResponse.."+s);
}
catch (IOException e) {
getRequest.abort();
Log.w(getClass().getSimpleName(), "Error for URL " + url, e);
}
finalJson=finalJson.substring(source.indexOf("[")+1)+"\"object:\"" ; // your logic to append object
Gson gson = new Gson();
parseJsonClass response = gson.fromJson(source, parseJsonClass .class);
感谢从我希望你能明白我的意思了我的意思是说
相关问题
- 1. 添加新对象到现有的json
- 2. Parse.com将JSON对象添加到JSON数组
- 3. 在运行时将JSON对象添加到JSON数组问题
- 4. 将对象添加到JSON中的数组
- 5. Unity JSON将数据添加到现有的json数据
- 6. Android将Json对象添加到数组中
- 7. 如何通过PHP将JSON对象数组添加到MySQL中
- 8. 将Json数组添加到对象列表中
- 9. MySQL的JSON对象追加到JSON对象的数组
- 10. JSON到对象数组,并添加项目到每个对象
- 11. 如何使用angular JS将JSON对象添加到JSON数组中?
- 12. 在C#中的JSON对象内添加JSON数组#
- 13. 如何将对象的现有JSON数组的特定对象复制到一个新的JSON数组
- 14. 以JSON数组添加对象与PHP
- 15. C#将项目添加到JSON对象
- 16. 将值添加到Ruby JSON对象
- 17. 将整个JSON对象添加到ArrayList
- 18. 将顶级JSON添加到Javascript对象
- 19. 将元素添加到JSON对象
- 20. 如何将值添加到JSON对象?
- 21. 如何将数组添加到JSON对象
- 22. 从我的JSON对象添加到我的列表数组中
- 23. 将新的JSON对象追加到Polymer中的数组中
- 24. 如何将数据对象添加到JSON对象?
- 25. 在javascript中添加子键值对现有数组(或JSON对象?)
- 26. 将JSON对象转换为JSON数组
- 27. JSON - 将对象转换为JSON数组
- 28. 在JSON数组前面添加一个新的JSON对象
- 29. 如何通过post方法将数据添加到现有的json对象?
- 30. 如何将新的值对添加到现有的json对象的草坪椅