开发者

Show feeds in android

开发者 https://www.devze.com 2023-01-08 02:09 出处:网络
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?

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.


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!

0

精彩评论

暂无评论...
验证码 换一张
取 消