1
我得到這個json
array
:解析JSON在Android中使用GET方法與排球工作室
{
"conferences": [
{
"id": 1,
"name": "Conferencia Magistral",
"description": "Conferencia bien chingona lalala",
"speaker": "Jorge",
"biography": "bioo",
"place": {
"name": "Auditorio",
"description": "Presentacion de peliculas y documentales"
},
"date": "31/10/2015",
"time": "16:00"
}
]
}
這是我在Android Studio中代碼:
queue = Volley.newRequestQueue(this);
JsonArrayRequest JsonRequest = new JsonArrayRequest(Request.Method.GET, url, new Response.Listener<JSONArray>() {
@Override
public void onResponse(JSONArray response) {
try {
for (int i = 1, count = response.length(); i < count; i++) {
EventInfo eventInfo = new EventInfo();
eventInfo.name = response.getJSONObject(i).getString("name");
eventInfo.date = response.getJSONObject(i).getString("date");
eventInfo.hour_event = response.getJSONObject(i).getString("time");
eventInfo.link="http://www.tallertoa.com/v1/files/gimgs/7_botanico-lamina-21.jpg";
eventInfo.description = response.getJSONObject(i).getString("description");
eventInfos.add(eventInfo);
}
recList.setAdapter(adapter);
Log.e("JSON", response.toString());
} catch (JSONException e) {
showErrorDialog("error Json parser", "error al parsear objeto Json Evento");
Log.e("json error",e.toString());
}
}
}, new Response.ErrorListener() {
@Override
public void onErrorResponse(VolleyError error) {
}
});
queue.add(JsonRequest);
}
所以,我不能解析此Json Array,我已經做了這個,但是用POST方法,所以我想知道你們中的任何人能否告訴我如何使用凌空
你可以發佈什麼和你在哪裏得到的錯誤/異常? – pgiitu