02-25-2010 12:54 PM
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