[This is part of the Android Diary.] I’d had an unofficial goal that the little Android goober I’m working on should be demo-able by the end of 2008. I made it by half an hour. It draws clickable zoomable renditions of geotagged feeds (RSS or Atom) on Google maps. The look and feel are cool. As of now, I’m not actually sure it’s useful for anything, but I think that geotagged feeds are potentially very interesting in general, so a viewer couldn’t hurt. The short-term lessons are about Android, though.
Here’s what it looks like. First, you enter the URI of a geotagged feed (the usability is lousy here and Android isn’t helping, I’ll write more about that in another note).
Here’s the map. The most recent entries are red, then they fade to blue as they get older. I should really figure out how to do a screencast, because while the map looks OK, what’s really elegant is how everything is live and responsive; you can nudge the map around, or use the built-in zoomer to move in and out, and the feed display updates itself. And of course, if you jab at one of the entries, it opens the linked Web page in the phone’s browser. (And then the excellent “Back” button takes you back to FeedMapper.)
Another nice thing is that since FeedMapper is an Android “Activity”, if you’ve got the app on your phone, you can easily launch it from another app in a nice smoothly-integrated way; and you can go straight to the map if you know the URI of the feed you want to map.
Now, on to the lesson, which is more interesting than the app.
Android Is Impressive · Background: I’m a decent Java programmer but not a superstar; haven’t buckled down seriously in five years or so. I’d never seen the Android-specific APIs before. The last time I worked on a non-Web UI it was in (gasp!) Motif, almost twenty years ago.
What does the app have to do?
Provide a space to type in a URI.
Fetch the feed over the Web.
Parse the XML.
Pull out titles, links, and any geotagging data.
Figure out how big the map has to be to include the points on the feed, and display it.
Decorate the map with a graphical rendition of the geotagged feed entries (currently just differently-shaded circles and curved lines connecting them).
Handle map-touch events and when the touch is near enough to an entry, launch a browser to display the linked Web page.
(There’s no error-handling to speak of yet.)
Consider, then, that I put this together between the 18th and 31st of December while doing some Sun work, celebrating the holidays, traveling to Regina and the in-laws’ farm in Saskatchewan, and doing a lot of child-care, with 800-and-change lines of Java code and another 75 of XML config goo.
What Makes It Work? · The community. The reference documentation is OK for JavaDocs but the tutorial pieces are very patchy, and there are lots of gotchas and ways to fail silently with no diagnostics.
Which turns out not to matter. When you hit a problem (and you will hit problems), in a high proportion of cases a Web search will turn up someone who’s already had it and solved it, usually with working code included.
Next Steps · As I said, I have no idea whether a viewer for geotagged feeds is interesting. (A viewer for multiple feeds at once would be more interesting, clearly.) The project has accomplished its goal for me: I’m now fairly up-to-date on the Android programming environment and community. If there turns out to be some actual interest I have nothing in principle against doing some further polishing and releasing it, but that would be real work, so I’d need a few good reasons.
Buttonhole me at a party or a conference though, and I’ll cheerfully demo.