Android RSS Feed Reader
The 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 Example
Create 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.
Create 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.
Create RSSParser.java class, in this class; we will use the instance of DocumentBuilderFactory class to parse the XML document.
Now, 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.
Create an activity WebActivity.java containing WebView, that load the content of the link clicked in the previous activity.
Add the INTERNET permission in AndroidMenifest.xml file.
JavaTpoint offers too many high quality services. Mail us on [email protected], to get more information about given services.
JavaTpoint offers college campus training on Core Java, Advance Java, .Net, Android, Hadoop, PHP, Web Technology and Python. Please mail your requirement at [email protected]
Duration: 1 week to 2 week