Code example for JSONArray

Methods: getJSONObject

0
		 * Parse information from data parameter and where possible, override 
		 * above date fields 
		 */ 
		int month = -1, day = -1, year = -1, hour = -1, min = -1; 
		try { 
			JSONObject obj = data.getJSONObject(0); 
			action = obj.getString("mode"); 
 
			String optionDate = obj.getString("date"); 
 
			String[] datePart = optionDate.split("/"); 
			month = Integer.parseInt(datePart[0]); 
			day = Integer.parseInt(datePart[1]); 
			year = Integer.parseInt(datePart[2]); 
			hour = Integer.parseInt(datePart[3]); 
			min = Integer.parseInt(datePart[4]); 
 
			/* currently not handled in Android */ 
			// boolean optionAllowOldDates = obj.getBoolean("allowOldDates"); 
 
		} catch (JSONException e) {