 | Level: Intermediate Frank Ableson (fableson@msiservices.com), Software designer
18 Mar 2008 What good is a mobile computing environment if you can't keep track of your favorite news feeds on the go? Sure, you can use Android's browser to read your favorite Web sites, but it's unlikely the sites are optimized for a screen two inches high. And besides, then you'll miss the opportunity to integrate RSS or other XML data with other mobile applications to make your own mash-ups. This tutorial shows you how to use the Android Developer Tools to read, parse, and display XML data. In this tutorial
Android is a platform that is rapidly gaining mindshare in the mobile marketplace. Even before consumer devices equipped with Android are available, thousands of developers are jumping into this mobile market, hoping to be prepared for the much anticipated introduction of Android-equipped devices in the near future. Rich devices, such as Android, demand content. Sometimes that content is in the form of games or a productivity application. Beyond mobile e-mail, however, the content that drives data usage the most is news and information. This content might look like news stories relevant to a particular financial market or something as ubiquitous as the weather forecast. And who isn't interested in the weather forecast for the upcoming weekend trip to the beach? Getting data to a mobile device in a fashion that is organic and usable becomes the challenge. Android includes the WebKit.org browser engine, which means that it delivers a top
quality browser experience to the mobile user. However, chasing down multiple Web sites
for news and information can be tedious in a small screen with limited input devices.
Don't misunderstand, the market has come a very long way since the WAP browser and
limited text-based information, however the power of mobile information is when it is
available at-a-glance: Enter RSS feeds. RSS is an acronym for "Really Simple
Syndication." In essence, RSS is a convenient way to distribute information of
interest. RSS makes XML data available; the data contains brief abstracts or teasers of
the full information source. If interested, the user can dig deeper and get "the rest
of the story" as the radio host Paul Harvey might say. This tutorial demonstrates the major aspects of XML data handling in the construction of an Android RSS reader.
Objectives - Review RSS basics.
- Look at Android RSS reader application architecture.
- Fetch and parse XML data with SAX.
- Render RSS data in Android.
Prerequisites
Mobile development experience is helpful, but
Java™ programming skills are required for the Android applications and will be helpful for this tutorial.
System requirements
You will need JavaScript enabled in your browser. This tutorial requires several technologies that work together. You will need to
obtain all of them to perform the steps of this tutorial. To build the sample
application in this tutorial, you must install the Android Software Development Kit (SDK) and ensure it functions on the development computer. Building Android applications in Eclipse is recommended, but not a requirement for this tutorial. You can get all the source code from Downloads in the tutorial.
Duration
1 hour
Formats html, pdf
|  | |  |