O'Reilly logo

Getting Started with UDOO by Emanuele Palazzetti

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Collecting weather forecast data

Now that our application's user interface is completed, we can proceed to implement the logic to store the user's location while fetching weather data from the RESTful web service. This implementation could be organized in the following steps:

  1. Update the Preset class to store the user's location.
  2. Handle voice recognition results when the user clicks on the weather_status TextView parameter.
  3. Add a new scheduled thread that fetches weather data and updates the user interface using the onWeatherChanged() callback.

We start updating the Preset class and realizing it with the following steps:

  1. Add, at the top of the class, the highlighted declaration used as a key to store and retrieve the location set by users:
    private static ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required