Header Sep
Java Tips, Tricks & Code
My Rating Score
Login to rate page
November 2003
Class Headlines

[Back]


This is a MIDlet example application that collects news headlines over the Internet and displays them in a list.

The application has several features; it uses a separate thread to collect the headlines and perform the Internet IO operation, but it ensures that only one network connection is executed at a time.

The news format is a straightforward text format, which is collected from a web server on the Internet using the http protocol.

The news file begins with an empty line. Thereafter, each news item consists of three lines:

The first line is a delimiter, which must be "%%".
The second line is the headline text.
The third line is the fully-qualified url of the full story body.  This is ignored by this application.

The server used in this demo is the publicly accessible http://www.osnews.com/, which happens to provide a news index in this format.

Class Headlines Sample Code

My Rating Score
Login to rate page