{ "data:" { "calendar": [ { "Booked":["13-11-2015","12-12-2015"], "Available":["20-12-2015","22-12-2015"] } ] } }
Could any one please help me how to get date from json array string
{ "data:" { "calendar": [ { "Booked":["13-11-2015","12-12-2015"], "Available":["20-12-2015","22-12-2015"] } ] } }
Could any one please help me how to get date from json array string
Your json should be like this
{
"data": {
"calendar": [
{
"Booked": [
"13-11-2015",
"12-12-2015"
],
"Available": [
"20-12-2015",
"22-12-2015"
]
}
]
}
}
You can use json online parser to check the validity of a json.
Now, coming back to your actual question.I dont have an android IDE so I will post a quick code to give u an idea
JSONObject jparentobj= new JSONObect("jsonString");
JSONObject datajObj= jparentobj.getJSONObect("data");
JSONArray calenderarray = datajObj.getJSONArray{"calender");
for (int i = 0; i < calenderarray.size(0); i++){
String booked = calenderarray.get(i).getString("Booked");
//Like this get each entity
}
Hope this helps you..