This app should contain a WeatherActivity that uses two Android Bound Services - one implementing a synchronous AIDL-based two-way mechanism (e.g., WeatherServiceSync) and one implementing an asynchronous AIDL-based two-way mechanism (e.g., WeatherServiceAsync)--to obtain weather information from a Weather Service web service. The Bound Services will require AIDL interfaces to specify the methods they support, which provide a location obtained via the WeatherActivity as a String (such as "Nashville, TN") and return a WeatherData object to the WeatherActivity that can be used to display various current weather-related information for that location.
WeatherActivity should support both synchronous and asynchronous AIDL-based two-way mechanisms for interacting with the WeatherServiceSync and WeatherServiceAsync. To avoid blocking the UI Thread in the WeatherActivity, the synchronous two-way mechanism should use an AsyncTask, which is covered here and here.
The app must handle runtime configuration changes properly. Information on how to handle these types of changes is available here A video outlining several approaches to runtime configuration changes appears here.
The interfaces and parcelable WeatherData object used to communicate between the WeatherActivity and the WeatherServiceSync and WeatherServiceAsync should at least support the functionality defined by the AIDL files provided in the skeletons. The WeatherActivity should not contact the Weather Service web service directly, but only via the getCurrentWeather() methods defined by the WeatherRequest and WeatherCall AIDL interfaces.
Since weather data doesn't change instantaeously, the WeatherServiceSync and WeatherServiceAsync should implement some for of caching pattern, whereby a call by WeatherActivity to getCurrentWeather() retrieves weather data from the WeatherService web service only every 10 seconds, regardless of the number of times getCurrentWeather() is called by the WeatherActivity. Any calls during the intervening time period should be serviced from the cache.
To obtain weather-related information, the Bound Services will need to parse the Json data returned from making an HTTP GET request via the Open Weather Map API. An example of the Json data returned by API can be seen by opening this link in your browser. Helpful information about creating Plain Ol' Java Objects (POJOs) from Json schemes is available here. There's also overview of a JsonReader parser here.
Requirements
To complete the assignment you will need to have a development setup consisting of Java JDK and Eclipse or Android Studio. Installation is pretty straightforward.
Source Code
https://github.com/nmesisca/POSA-15/tree/master/assignments/assignment3