Common abbreviations
Ajax:asynchronous JavaScript + XML
API: Application Programming Interface
CSV: comma-separated values
CSS: Cascading Style Sheets
DOM: Document Object Model
HTML: Hypertext Markup Language
HTTP: Hypertext Transfer Protocol
IDL: Interface Description Language
Json:javascript Object identification
Sax:xml Simple API
SDK: Software Development Kits
UI: User Interface
URL: Uniform Resource Locator
XML: Extensible Markup Language
3g: Third generation mobile phone technical standard
Android applications must access data that is located on the Internet, and Internet data can be in several different formats. This article describes how to use three data formats in an Android application:
Xml
Json
Google's protocol buffers
Start by developing a Web service that converts CSV data into XML, JSON, and protocol-buffers formats. Then build a sample Android application that extracts the data from a WEB service in any format and parses it and displays it to the user.
To do the exercises in this article, you need the latest Android SDK and Android 2.2 platform. The SDK also requires you to install a Java™ Development Kit (JDK), and JDK 1.6.0_17 is used in this article. You do not need to have an Android physical device; All code will run in the Android emulator of the SDK. This article does not teach you how to develop Android, so it is recommended that you be familiar with Android programming. Of course, only the knowledge of the Java programming language can also complete the study of this article.
You also need a Java Web application server to run the Web services that the Android application uses. In addition, you can deploy server-side code to Google App Engine. See the Downloads section for complete source code.