Search code examples
androidrssfeedfeedburner

Show feeds in android


I want to show feeds from a blog in a listview. It would be really help if you guys can suggest some tutorials or how to do it?

thanks in adv.


Solution

  • I can point you in the right direction, using standard Android SDK components.

    Your solution will consist of several pieces - an HTTP downloader, an RSS parser (presumably the blogs have public RSS feeds), a ListAdaptor, and your ListView.

    1. Firstly, you need to grab the RSS file from the blog. There are a bunch of ways to do this, I'd suggest using HttpClient and HttpGet.
    2. Next, you'll need to parse the RSS file you downloaded. For this, you can use XMLReader. Writing a good RSS parser is probably the trickiest bit!
    3. Now you've got your data parsed, store it in a list and write a ListAdaptor.
    4. Hook the ListAdaptor upto your ListView using setAdaptor and you're good to go.

    If this all sounds a bit complicated, there are various Java RSS libraries that'll perform steps 1 and 2 for you.

    You may also want to take a look at the source code of android-rss, and give IBM's XML article a good read!