J2ME Polish
J2ME Polish 2.4 Documentation
Enough Software

RssBrowser

The RssBrowser dislaying a digg feed.
Use the RssBrowser to display RSS 2.0 feeds.

Design

The above design has been realized using following CSS settings:

.rssBrowser {
	view-type: midp2;
}

.browserLink {
	font-color: blue;
	font-style: bold;
}

.browserLink:hover {
	font-color: red;
}

The RssBrowser, like the HtmlBrowser, uses the default CSS styles .browserLink, .browserText or .browserInput.

CSS Attributes for the RssBrowser

You can use the following attributes for designing a RssBrowser:

RSS Commands

The RssBrowser uses two commands for letting the user interact with RSS feeds. You can use the following preprocessing variables or translations within resources/messages.txt for adjusting these commands:

  • polish.rss.command.select: Lets the user view the description of a RSS item.
  • polish.rss.command.followlink: Allows the user to open the linked RSS article page.

These are the default translations:

polish.rss.command.select=Show
polish.rss.command.followlink=Go

Programming

Using the RssBrowser is not difficult. The following code snippet shows how to create an RssBrowser:

//#style rssBrowserForm
Form form = new Form("Browser");
//#style rssBrowser
this.rssBrowser = new RssBrowser( this ); 
// "this" implements an ItemCommandListener
form.append( this.rssBrowser );

If you want to view a feed, call RssBrowser.go(String url):.

this.rssBrowser.go( "http://www.digg.com/rss/index.xml" );

If you want to include descriptions directly on the overview page instead of in the linked page, call RssBrowser.setIncludeDescriptions(boolean includeDescriptions):

this.rssBrowser.setIncludeDescriptions( true );

Please refer to the "rss" sample application for a working example.

JavaDoc

back to top