Up vote 0 down vote favorite share g+ share fb share tw.
I am working on an android app in which I have to fetch data from a RSS feed, I am able to read Title, link and facing problem with description. If it is in this format worsening of developments in...... I am able to read it , but in some rss feeds having this format also I am not getting this text.. this is the Rss feed url : news.yahoo.com/rss/politics. How to read this description.. android rss read feed link|improve this question edited Feb 14 at 11:50 asked Feb 13 at 9:14RajaReddy P1 88% accept rate.
I have parser for remove this tag but are you sure first description like .. Mitt Romney and his under-funded opponents are taking advantage of a weeklong lull in the Republican presidential nomination fight — no debate or primary is slated — to raise the money needed to carry out Super Tuesday strategies and compete in states beyond. – Samir Mangroliya Feb 14 at 9:20 yes that is the description . I want get that string at the same time if the description in normal format I want to get that also.. – RajaReddy P Feb 14 at 9:51 see my answer and its has two class(HTMLRemoverParser,HTMLRemoverBean)class for item and parsing.
In java. Cheers! – Samir Mangroliya Feb 14 at 10:07.
Package com.samir. XMLParser; import java.io. *; import java.net.
*; import java.util. *; import javax.xml.parsers. *; import org.
W3c.dom. *; public class HTMLRemoverParser { HTMLRemoverBean objBean; Vector vectParse; int mediaThumbnailCount; boolean urlflag; int count = 0; public HTMLRemoverParser() { try { vectParse = new Vector(); URL url = new URL("http://news.yahoo.com/rss/politics"); URLConnection con = url.openConnection(); System.out. Println("Connection is : " + con); BufferedReader reader = new BufferedReader(new InputStreamReader( con.getInputStream())); System.out.
Println("Reader :" + reader); String inputLine; String fullStr = ""; while ((inputLine = reader.readLine())! = null) fullStr = fullStr. Concat(inputLine + "\n"); InputStream istream = url.openStream(); DocumentBuilder builder = DocumentBuilderFactory.newInstance() .
NewDocumentBuilder(); Document doc = builder. Parse(istream); doc. GetDocumentElement().normalize(); NodeList nList = doc.
GetElementsByTagName("item"); System.out.println(); for (int temp = 0; temp ", ""); objBean. Description=noHTMLString; objBean. Link = getTagValue("link", eElement); objBean.
Pubdate = getTagValue("pubDate", eElement); } } for (int index1 = 0; index1 Println("Title is : " + ObjNB. Title); System.out. Println("Description is : " + ObjNB.
Description); System.out. Println("Link is : " + ObjNB. Link); System.out.
Println("Pubdate is : " + ObjNB. Pubdate); System.out.println(); System. Out .
Println("-------------------------------------------------------------------------------------------------------------"); } } catch (Exception e) { e.printStackTrace(); } } private String getTagValue(String sTag, Element eElement) { NodeList nlList = eElement. GetElementsByTagName(sTag). Item(0) .getChildNodes(); Node nValue = (Node) nlList.
Item(0); return nValue.getNodeValue(); } public static void main(String args) { new HTMLRemoverParser(); } } And Bean is :: package com.samir. XMLParser; public class HTMLRemoverBean { public String title; public String description; public String link; public String pubdate; }.
– Samir Mangroliya Feb 14 at 10:28 yes I am using those two class, now I am trying to display those items in list view. – RajaReddy P Feb 14 at 10:36 thank you very much ,, I am searching for this from that last 2 days.. – RajaReddy P Feb 14 at 11:40 yes I know that I think this is yours seconds question on this so today I do this first .... – Samir Mangroliya Feb 14 at 11:48.
When you detect that the block of text is HTML, open it in a WebView instead of a TextView. My solution looks like this: WebView wv = (WebView) v. FindViewById(R.id.
Feed_entry_detail); wv. LoadData(mContentFromFeed, "text/html; charset=utf-8", null).
I have to use textview only because I am able to display items information inthe list view.. – RajaReddy P Feb 13 at 9:33.
I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.