我在获取一维方面遇到问题 JSON请指导我问题在我JSON或我的代码中?
JSON:
{
"data": {
"id": "S000010",
"name": "ZS Solutions",
"email": "zswebs@gmail.com",
"phone": "051-1234567",
"address": "p.o.box 123",
"about": "im the company\r\nHAhahhaa"
}
}
Run Code Online (Sandbox Code Playgroud)
Android活动JSON检索代码:
ArrayList<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>();
// TODO Auto-generated method stub
try {
HttpClient httpclient = new DefaultHttpClient();
HttpPost httppost = new HttpPost("abc.php?Id="+id+"");
httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs));
HttpResponse hresponse = httpclient.execute(httppost);
HttpEntity entity = hresponse.getEntity();
is = entity.getContent();
String result=co(is);
JSONObject json=new JSONObject(result);
JSONArray a= json.getJSONArray(data);
for (int i = 0; i <= …Run Code Online (Sandbox Code Playgroud)