Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Highlighted
Regular Visitor
Posts: 1
Registered: ‎02-25-2010
My Device: 8900
My Carrier: o2

RSS parser not working on device but working fine on simulator?

Hi everyone,

 

I am working on an app for blackberry and it has a RSS reader. It reads fine on the simulator but when I installed it on the actual device, it fails to read anything from reader. Any help ppppplease?

 

here is a snapshot of my code:

 

DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();

DocumentBuilder db = dbf.newDocumentBuilder();


String url=link;

          

      conn=(StreamConnection)Connector.open(link);

          

      DocumentBuilderFactory docBuilderFactory

              = DocumentBuilderFactory. newInstance();

      DocumentBuilder docBuilder

              = docBuilderFactory.newDocumentBuilder();

      docBuilder.isValidating();

      doc = docBuilder.parse(conn.openInputStream());


 Element docEle =  doc.getDocumentElement();


 NodeList feedList =  docEle.getElementsByTagName("item");


 if (feedList != null && feedList.getLength() > 0) {

                                

            for (int i = 0; i < feedList.getLength(); i++) {

               

             Node node = feedList.item(i);

               

             if (node.getNodeType() == Node.ELEMENT_NODE) {

               

             System.out.println("=====================");

            

            

            

               

         Element e = (Element) node;

          

         NodeList nodeList = e.getElementsByTagName("title");

 

 

.......... and I get the rest of the rss field .....

 


Many thanks in advance