Parse JSON

Basic example of parsing data from a JSON.

Example JSON file
{
   "temp": {
      "min":"11.34",
      "max":"19.01"
   },
   "weather": {
      "id":"801",
      "condition":"Clouds",
      "description":"few clouds"
   },
   "pressure":"1023.51",
   "humidity":"87"
}

Function to extract the 'condition' from the JSON file.

String getCondition(String JSONString) {
   JSONObject forecast = new JSONObject(JSONString);
   JSONObject weather = forecast.getJSONObject("weather");
   return weather.getString("condition");
}