Affiliate links on Android Authority may earn us a commission.Learn more.

Building a simple RSS reader - full tutorial with code

July 20, 2025

For this Android developer tutorial, we are going to create a simple RSS reader app. This app would fetch RSS feeds from a single, user specified internet address, and display the contents using a RecyclerView. If you aren’t familiar with the RecyclerView widget, check out our previous tutorial onusing a RecyclerView.

Sample RSS Feed

An RSS feed is a plain text document, formatted in XML. Being XML, it is relatively easy for humans to read, and also not difficult for programs to parse. A sample XML document is shown below.

We can see from the sample above, the feed has a title, a description, link, last build date, a publish date and a time to live. For this tutorial, we are only interested in the title, description and link.

simple_rss_featured

There are also two items in the feed, and each has a title, a description and a link, along with aguid(globally unique identifier) and publish date. Most feed items have other tags, but, for our simple RSS  reader, we are only concerned with the title, description and link.

Preparing the project

Of course, the first thing we will do is create a new Android Studio project with an empty activity, which we’ve named SimpleRSSReader. In the AndroidManifiest.xml file, we include the INTERNET permission. Since the rss reader will fetch feeds from the internet, wemustdeclare this permission.

Also, we intend to use thesupport library,RecyclerViewanddesign support library, so we add those to our app build.gradle file. The latest version as at publication is 25.0.1.

simple_rss_aa_fetched

Great. With the initial setup complete, let’s get to work.

Design the layout

For our simple app, we want the user to enter a target RSS feed url, and when he clicks a button, our rss reader app will fetch the feed and display the feed items in a recyclerview.

Did you notice that we enclosed our recyclerview within aSwipeRefreshLayout? A SwipeRefreshLayout is a design support library widget that allows users pull down to refresh, and shows a nice circular progress bar.

simple_rss_layout

Creating the MainActivity

Within the MainActivity class, the first thing we do is define references to the EditText, the Button, RecyclerView and SwipeLayout. We also setup a click listener for the Button, and an OnRefreshListener for the SwipeRefreshLayout.

Both the Button and SwipeRefreshLayout perform the same action, which is to start a new FetchFeedTask. The FetchFeedTask is anAsyncTask, which allows us perform possible long running tasks in a background thread. If you try to fetch feeds from a url on the main thread, your app will become unresponsive, and can appear to the user to have stopped working. Ever since Ice-cream Sandwich, Android no longer allows apps make network calls on the main thread. For a refresher on using AsyncTask, you can check out our previous article that discussedhow to use a web API from your Android app.

simple_rss_swipe_refresh

The FetchFeedTask has three simple methods:

Since Android allows manipulation of UI elements (Buttons, SwipeRefreshLayout, etc) only on the UI/Main thread, we can update the UI both in onPreExecute, and onPostExecute, but not in doInBackground.

In the code snippet above, you’re able to see that we only update the UI in onPreExecute and onPostExecute, while all the computation is done within doInBackground. We define FetchFeedTask as an inner class in MainActivity, so that we can access the MainActivity layout widgets.

simple_rss_item_feed

In doInBackground, we first confirm that the url entered is not empty, then we add a ‘http://’ to the url if the user left it out. The next step is to open a url connection, using the url.getConnection().getInputStream() method. Finally, we call a method named parseFeed() to parse the resulting RSS feed.

Parsing the RSS feed

Thankfully, android contains some utility classes and interfaces to handle XML parsing. For our rss reader, we will use anXmlPullParserinstance to handle parsing the feed. XmlPullParser can have either an InputStream or a Reader as the source of data. We simply read each XML tag in the RSS feed until we get to the end of the document. You can see in the code snippet below, that we are only interested in the XML tag if it is either title, description or link.

RssFeedModel is a simple helper class we created to hold title, description and link information for an RSS feed item.

Displaying the feeds

At this point, we are ready to fetch, and parse RSS feeds. However, we still need to display the results in our rss reader RecyclerView. Recall that in the onPostExecute() method above, there is the line:

Once again, if you haven’t used a RecyclerView before, check out our previous tutorial onUsing RecyclerView. It is very easy and straightforward to use. To display each feed item, we create a layout file, called item_rss_feed.xml.

And finally, the RssFeedListAdapter.

As always, the complete source isavailable on github. You can look into styling your item_rss_feed.xml, displaying more content than just the item title, description and link, and/or, for the adventurous, writing your own RSS news aggreagator with multiple feeds from multiple sources.

Happy coding.

Thank you for being part of our community. Read ourComment Policybefore posting.