Which Jacket? An app by Ashley Kaminski
Yet another weather app… …but this one gives you relevant data! Returns the current weather and the weather in 3 hours Suggests a jacket to wear at both times Changes its suggestion based on current conditions
Weather Data Provided via wunderground.com’s weather API Get request using any number of parameters Returns data in JSON or XML format
How it works User enters zipcode Zipcode is entered into correct URL to send GET request in AsyncTask Meanwhile, GUI switches from input screen to data screen
How it works Once the data is returned, the JSON is parsed in a different AsyncTask "local_time_rfc822":"Fri, 12 Oct :33: ", "local_epoch":" ", "local_tz_short":"EDT", "local_tz_long":"America/New_York", "local_tz_offset":"-0400", "weather":"Clear", "temperature_string":"70.9 F (21.6 C)", "temp_f":70.9, "temp_c":21.6, "relative_humidity":"-999%", "wind_string":"From the WNW at 5.0 MPH Gusting to 12.0 MPH", "wind_dir":"WNW", "wind_degrees":293, "wind_mph":5.0, "wind_gust_mph":"12.0", "wind_kph":8.0, "wind_gust_kph":"19.3"
How it works This Task creates a Jacket element, which stores the weather data and also computes the suggested jacket public class Jacket { private long currentTemp; private String futureTemp; private String currentConditions; private String futureConditions; private String currentJacket; private String futureJacket; private boolean currentUmbrella; private boolean futureUmbrella; private String location;
How it works UI is updated via callback