-2

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?

String
  • 3,660
  • 10
  • 43
  • 66
  • 1
    It does not seem that you have tried anything yet... AND you are asking three questions in one. You should try something before asking. But for 1) please check http://stackoverflow.com/questions/9890222/need-some-help-in-parsing-this-xml-in-j2me-platform – Telmo Pimentel Mota Jul 30 '12 at 20:09
  • Hiii,i already developed rss reader app using lcdui component,for 5 rss xml files,but i have a requirement to show those 5 rss feed xml files in a tab based screen,that means,in one screen ,we have to create 5 tabs,after that ,if i clcick on each tab,i need to display lcdui list screen(image and title),but,i dont know ,tabs are created using lwuit,but my rss app developed using lcdui component,so i cannot able to add lcdui list screen, in lwuit tab based component,so i decided to change my rss app to lwuit? any help?can we develop tabs using lcdui and ,can we able to add lcdui list to tab? – String Jul 31 '12 at 04:16
  • If you can use LWUIT go through this tutorial http://lwuit.java.net/tutorial/index.html – Telmo Pimentel Mota Jul 31 '12 at 12:50

2 Answers2

1

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.

Shai Almog
  • 51,749
  • 5
  • 35
  • 65
0

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

String
  • 3,660
  • 10
  • 43
  • 66