7 WeatherViewer App
Objectives
In this chapter you’ll:
Use the free
OpenWeatherMap.org
REST web services to get a 16-day weather forecast for a city specified by the user.Use an
AsyncTask
and anHttpUrlConnection
to invoke a REST web service or to download an image in a separate thread and deliver results to the GUI thread.Process a JSON response using package
org.json
classesJSONObject
s andJSONArray
s.Define an
ArrayAdapter
that specifies the data to display in aListView
.Use the
ViewHolder
pattern to reuse views that scroll off the screen in aListView
, rather than creating new views.Use the material design components
TextInputLayout
,Snackbar
andFloatingActionButton
from the Android Design Support Library.
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.