views:

34

answers:

1

Hi..

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.

A: 

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!

Dave
Thanks buddy.. i am following this..but i am getting an execption..07-16 13:21:34.240: WARN/System.err(3764): java.lang.IllegalStateException: Scheme 'feed' not registered.
mudit
Sounds like you forgot to add 'http://' to the start of the RSS URL.
Dave
my url is like: feed://feeds.feedburner.com/somename1/something1
mudit
You need to use an HTTP URL, e.g. `http://feeds.feedburner.com/somename1/something1`.
Dave
Thanks man..i guess that solved the issue..now i am only left with xml parsing.. :)
mudit