1

I've been told by long-time Java developers that Apache's Rome module is the definitive library for reading & generating RSS & Atom feeds.

I've had a look at the library - it does not seem to be under active development right now. Is this really the best available? Specifically, I'm trying to write an Android application which will read in a number of feeds. I'm worried that Apache Rome might be to heavyweight for a handheld device.

Are there any alternatives that I ought to consider? My main criteria are:

  • Lightweight enough to run on a low-power device.
  • Easy to use API
Salim Fadhley
  • 22,020
  • 23
  • 75
  • 102
  • if the xml you will parse isn't crazy complex, just roll your own parser using a SAX Parser or whatever. – james Aug 29 '11 at 14:51
  • I'd really rather not spend the time re-inventing this particular wheel. The XML in question are typical RSS/Atom feeds generated by blogging software (e.g. wordpress). They typically contain errors, hence the need for a very robust parsing tool. – Salim Fadhley Aug 29 '11 at 14:57

3 Answers3

7

There is a repackaged version of Rome for Android: http://code.google.com/p/android-rome-feed-reader/. I know it is used by the Spring Android library.

Eric Levine
  • 13,536
  • 5
  • 49
  • 49
  • Excellent, I will check it out. – Salim Fadhley Aug 30 '11 at 09:56
  • 1
    This answer should be accepted. I spent a day trying to get Rome working in my Android application project, because of it's half assed java.beans.x implementation. Sadly I saw it afterwards :) – slinden77 Dec 27 '13 at 00:34
  • Unfortunately, the Android linter sees that this repackaged jar contains refs to java.awt, java.applet, etc. Not a clean Android library. –  Jul 19 '16 at 20:19
1

There is also this library I wrote: https://github.com/Pkmmte/PkRSS

It uses a fluent API for easy usage, it's very lightweight + fast, supports custom feed item properties, and is compatible with most RSS2 feeds by default but allows you to plug in your own custom RssParser to support all kinds of feeds.

Pkmmte
  • 2,822
  • 1
  • 31
  • 41
1

For a recent project I tried all available methods for parsing rss and came to the conclusion that http://developer.android.com/reference/org/xmlpull/v1/XmlPullParser.html is the most decent one you might use. Easy to use and performant enough to run on low powered devices as well.

NewProggie
  • 1,015
  • 1
  • 10
  • 24
  • This has the benefit of being part of the standard library, but I'm worried that I'd have to do a lot of work to implement all of the various oddities found in feeds. – Salim Fadhley Aug 29 '11 at 15:18
  • 1
    Of course, this will work. But the OP said he didn't want to reinvent the wheel, and is explicitly seeking for a RSS and a Atom library, not a general purpose XML parsing framework. – rds Aug 29 '11 at 15:20
  • Then this question makes no sense to my mind. No lib can guess what you actually want to do with the rss feed. – NewProggie Aug 29 '11 at 15:28
  • I think you misunderstand me: I'm just after a lib (something like Rome) which can make the job of parsing the kind of RSS/Atom we see on the web much easier. Even though feed XML is quite a simple format there are real-world complexities which make parsing into quite a challenge (if you want to do it robustly). If I were to hand-roll this component to a good standard it might take me as much time as the rest of the project! – Salim Fadhley Aug 30 '11 at 09:57