Android RSS Feed ReaderThe RSS stands for Rich Site Summary. It is used to read the latest update made on the content of a blog or website. RSS feed is mostly used for reading the summary of a blog (newsletter). The content for RSS feed is provided in XML format. The XML format for RSS reader contains the following tags. In this tutorial, we will read the content of the website (Rediff.com and Cinemablend.com) using Android RSS Feed reader. The contents are displayed in ListView of Android and clicking on these items will load their respective URL. Android RSS Feed Reader ExampleCreate an activity MainActivity.java with the following code. Clicking on the button of this activity redirect to RSSFeedActivity.java class and load the content of a given URL. activity_main.xmlMainActivity.javaCreate a layout rss_item_list_row.xml which contains the fields of a newsletter (page URL, title, publishing date) which are displayed in RSS Feed. rss_item_list_row.xmlRSSItem.javaCreate RSSParser.java class, in this class; we will use the instance of DocumentBuilderFactory class to parse the XML document. RSSParser.javaNow, create an activity RSSFeedActivity.java with the following code. This class uses AsyncTask class to load the items of RSS Feed from the URL in the background. activity_rssfeed.xmlRSSFeedActivity.javaCreate an activity WebActivity.java containing WebView, that load the content of the link clicked in the previous activity. activity_web.xmlWebActivity.javaPermission RequiredAdd the INTERNET permission in AndroidMenifest.xml file. Output: Next TopicVolley Fetch JSON |
We provides tutorials and interview questions of all technology like java tutorial, android, java frameworks
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India