7.5 Class Weather
This app consists of three classes that are discussed in Sections 7.5–7.7:
Class
Weather
(this section) represents one day’s weather data. ClassMainActivity
will convert the JSON weather data into anArrayList<Weather>
.Class
WeatherArrayAdapter
(Section 7.6) defines a customArrayAdapter
sub-class for binding theArrayList<Weather>
to theMainActivity
’sListView
.ListView
items are indexed from0
and eachListView
item’s nested views are populated with data from theWeather
object at the same index in theArrayList<Weather>
.Class
MainActivity
(Section 7.7) defines the app’s user interface and the logic for interacting with theOpenWeatherMap.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.