Question

I am new to J2me I have a requirement to develop Rss Reading Application using LWUIT in j2me(java)for series 40 Device. 1)I need to read Rss File 2)i need to display Title and Image from Rss xml File on LWUIT List Screen 3)If i click on Title ,i should be able to display Form Screen ,On LWUIT Form i need to display Description and Publish Date from Rss File

any sample Code ,I need help?

Was it helpful?

Solution

Check out the RSS reader component that is a part of LWUIT4IO or standard part of Codename One.

You can just place it using the GUI builder to create such an application.

OTHER TIPS

To Develope an Rss Reader Application using LWUIT , we can use the below Code:

RssMidlet:

import com.sun.lwuit.*;
import com.sun.lwuit.animations.Transition3D;
import com.sun.lwuit.events.ActionEvent;
import com.sun.lwuit.events.ActionListener;
import java.util.Vector;
import javax.microedition.midlet.*;

 public class RssMidlet extends MIDlet implements ActionListener {

    private List rssFeedList;
    private Vector rssFeed;
    private Image image;
    private Form form1;

    public RssMidlet() {
        Display.init(this);
        rssFeed = new Vector();
        form1 = new Form();
        form1.setFocus(true);
        form1.addCommandListener(this);
        form1.setScrollableY(true);
        form1.setTransitionInAnimator(Transition3D.createRotation(250, true));
        //Initialize a  List Object with Vector ref rssFeed
        rssFeedList = new List(rssFeed);
        rssFeedList.setRenderer(new NewsListCellRenderer());
        rssFeedList.setFixedSelection(List.FIXED_NONE);
        rssFeedList.setItemGap(0);
        form1.addComponent(rssFeedList);
    }

    public void startApp() {

        String url = "Your Input Rss File Here";
        ParseThread myThread = new ParseThread(this);
        //this will start the second thread
        myThread.getXMLFeed(url);
    }

    public void pauseApp() {
    }

    public void destroyApp(boolean unconditional) {
    }

        public void addNews(RssModel newsItem) {
        rssFeed.addElement(newsItem);

       form1.show();
    }

    }
}

You can create a NewsListCellRenderer class by Referring this Example LWUIT Blog ContactsRenderer Example

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top