Create a BlackBerry application with open source tools, part 2nd build an RSS reader

Source: Internet
Author: User
Tags thread class xml parser

Open source has revolutionized the software development marketplace, and new sources of information are emerging that are strongly impacting traditional news channels in this way. Today we can get free messages from a variety of internet resources and mainstream internet media. We can get a message by reading a different Web site, but this is tedious. So, how about updating the interesting news at any time? Isn't it very important to receive your favorite messages in a centralized way? On the BlackBerry, you can implement these features through an RSS reader. This tutorial is part 2nd of the series tutorial "Creating a BlackBerry application with open source tools." This tutorial will create a BlackBerry RSS reader that allows your BlackBerry to receive messages anytime and anywhere, and explore the RSS data release format.

Before you start

This series explores how to develop a BlackBerry application with open source and Java™ technology through a mobile phone data collection application. The 1th part introduces the BlackBerry development, including the platform introduction, the BlackBerry development tool overview, and the complete data collection application construction.

This tutorial explores the development of a BlackBerry application primarily through a sample mobile phone content management application. This example demonstrates a basic RSS reader using a free BlackBerry development tool. Experience with developing a mobile phone application can be helpful, but not necessary. Developing a BlackBerry application must understand Java programming skills, but these techniques are not necessary in this tutorial. The RSS feed is the source of the data content used by the sample application in this article. It helps to be familiar with RSS, but if you only want to understand the architecture of the mobile phone content management application, do not ask.

About this tutorial

Why do you write an RSS reader for your BlackBerry? BlackBerry and other mobile phones have become a part of our lives. The user interface (UI) of our mobile device is becoming more and more powerful, and the technical performance is getting better, for example, data storage speed, storage capacity and processing speed are increasing. If we can't make full use of our equipment, they are just ordinary telephones. Our equipment needs a wealth of content! Remember, "the pen is better than the sword." The power of words is immense. Today, our text is expressed in numbers and movable. The information flow is free, and subscriptions to interested messages are free, which lays the foundation for free, open source communities. What other Open-source technology is better than RSS readers for free information?

This tutorial builds a mobile message reader for the BlackBerry platform using the Java programming language. There are also RSS readers for mobile devices, but the goal of this article is not to compete with commercial RSS applications. This article demonstrates how to build open source applications to help you build useful applications for handling content and its publishing. Learn how to manage RSS feeds for messages from different sources. This paradigm also applies to other applications, such as mobile tool management data, employee dispatch data, and even mobile search engines.

Although the BlackBerry is based on a popular platform, it still requires support from Third-party applications. To share the results of an application, the open source community is the best way. This tutorial provides a foundation for building open source RSS reader applications that you can extend to achieve other useful functionality.

This tutorial is a brief introduction to RSS, and then an in-depth discussion of the conditions required to implement the BlackBerry mobile RSS reader. You can download the full BlackBerry application source code.

System Requirements

This tutorial demonstrates how to use the BlackBerry development tool to build an open-source blackberry RSS reader. You will need a BlackBerry Java Development environment (JDE) or other available environment to develop an RSS reader application. This tutorial uses the V4.0.2 version of JDE. In addition, this tutorial provides some examples of RSS feed links, but you can replace them with your own links as needed.

Sample Code Overview

In this tutorial, you will build a mobile RSS reader application called Ibmrss for your BlackBerry. In the process of reading this article, try to let the mind break through the scope of the message reader, the RSS data format can be used on many other applications. You can download the full source code. Source code snippets include:

Ibmrssapplication This class contains the entry point for the application. Ibmrssscreen This class contains UI elements, including menus and a listfield. and provides user interaction functions. Ibmrssstorage This class encapsulates the storage of data, including various access/helper routines. SetupData This method is responsible for organizing the relationship between the storage data and the user interface. It is used after starting and refreshing the RSS feed. LoadFeed This method displays the entries from the specific RSS feed selected in the UI. ShowItem This method displays a description of the specific RSS entry and gives an option to view the full Story. Rssdescriptionshowitem calls this class to display a specific RSS entry. Rsskeylistener is responsible for classes that interact with the BlackBerry keyboard. It looks for the Enter and ESC keys. Drawlistrow This method is responsible for drawing text for the ListField used to display RSS data. A ListField will display a set of RSS feeds and list entries in a specific RSS feed. Ibmrssxmlhandler This class extends the DefaultHandler class to handle parsing events generated by the SAX XML parser engine. The SAX XML parser engine is used to parse RSS feeds. Ibmrsscomms This class is responsible for obtaining all RSS feeds of interest. It expands the Java.lang.Thread class. The GUID class contains final members that are useful for communicating across threads and uniquely identifying the data store for an application. Utils This class contains a very interesting method: Split. This implements a simple word breaker (tokenizer) for processing data stored in RecordStore (implemented by Ibmrssstorage).

Really Simple Union (really simplicity Syndication,rss)

This section is a brief look at some of the history, structure, and potential uses of RSS. Once you know this data format, you can start building an RSS application.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.