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.
activity_main.xml
MainActivity.java
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.
rss_item_list_row.xml
RSSItem.java
Create RSSParser.java class, in this class; we will use the instance of DocumentBuilderFactory class to parse the XML document.
RSSParser.java
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.
activity_rssfeed.xml
RSSFeedActivity.java
Create an activity WebActivity.java containing WebView, that load the content of the link clicked in the previous activity.
activity_web.xml
WebActivity.java
Permission Required
Add the INTERNET permission in AndroidMenifest.xml file.
Output: