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:
Presetclass to store the user's location.
Handle voice recognition results when the user clicks on the
Add a new scheduled thread that fetches weather data and updates the user interface using the
We start updating the
Preset class and realizing it with the following steps:
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 final String CURRENT_PRESET = "__CURRENT__"; private static final String CURRENT_LOCATION = "__LOCATION__";
public static void setLocation(Context ctx, String name...