package com.nikolak.weatherapp.ForecastIO;



import org.json.JSONException;
import org.json.JSONObject;

public class Forecast {
    public Currently currently = new Currently();
    public Hourly hourly;
    public Daily daily;

    private ForecastAPI forecastAPI = new ForecastAPI();

    public Boolean updateForecast(String lat, String lon) throws JSONException {
        JSONObject response = forecastAPI.getDefault(lat, lon);
        if (response==null) {
            return false;
        }

        JSONObject currentlyJObject = response.getJSONObject("currently");
        this.currently.ConstructFromJson(currentlyJObject);
        return true;
    }


}

@@ -197,16 +197,31 @@
 y hourly
+ = new Hourly()
 ;%0A    pu
@@ -236,16 +236,30 @@
 ly daily
+ = new Daily()
 ;%0A%0A    p
@@ -657,16 +657,140 @@
 Object);
+%0A%0A        JSONObject hourlyJObject = response.getJSONObject(%22hourly%22);%0A        this.hourly.constructFromJson(hourlyJObject);
 %0A       

Parse hourly data