7.5 Class Weather

This app consists of three classes that are discussed in Sections 7.57.7:

  • Class Weather (this section) represents one day’s weather data. Class MainActivity will convert the JSON weather data into an ArrayList<Weather>.

  • Class WeatherArrayAdapter (Section 7.6) defines a custom ArrayAdapter sub-class for binding the ArrayList<Weather> to the MainActivity’s ListView. ListView items are indexed from 0 and each ListView item’s nested views are populated with data from the Weather object at the same index in the ArrayList<Weather>.

  • Class MainActivity (Section 7.7) defines the app’s user interface and the logic for interacting with the OpenWeatherMap.org daily forecast web service and processing the JSON response.

In this section, ...

Get Android How to Program, 3/e now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.