Document directory
Android weather forecast application design (I) I. Demand Analysis
There are already many weather forecasting applications on the Android platform, including well-designed works (such as moji weather ). This article introduces a simple implementation of weather forecasting. This application is the first complete Android Application of the author of this article. It records the design process for emergency purposes and provides reference for beginners, you are also welcome to exchange letter (frankxuanhui@yahoo.com.cn ).
Interface Demonstration:
Basic functions:
(1) display the detailed weather conditions at the current time on the screen, and display the weather forecast for the next three to four days.
(2) A drop-down list is provided for users to select their cities, and a "OK" button is provided to query the weather.
(3) On the basis of (2), a text input box is provided for the user to enter the city name that does not exist in the city drop-down list, and the "OK" button is provided for weather query.
(4) The UI layout can be adjusted based on the actual situation when the screen is switched between the landscape screen and the portrait screen due to the user's change in the mobile phone direction.
(5) If the weather information of the corresponding city cannot be found, it is necessary to identify and handle exceptions.
Extended functions:
(1) provides the skin replacement function (allows users to select images with built-in skins or file systems), and saves the selected skin as the default skin through lightweight databases.
(2) the "send weather forecast to friends" button is provided to send a text message in a certain format to friends based on the current weather forecast query result.
Ii. Design Ideas
(1) access Google weather API to obtain weather information, the specific URL format is http://www.google.com/ig/api? Weather = query (the city name can be entered in the query, but currently only Pinyin is accepted)
(2) Google weather API returns an XML document containing weather information. You can use saxparser to parse this document to obtain weather forecast information.
(3) design three activity types for the main weather forecast interface, skin change interface, and contact list reading interface, and switch between them through intent.
For detailed design, see Android weather forecast application design (2).