published: November 11th, 2008

Android - Ruby on Rails Project Part 2: Some simple SAX parsing

Must….Finish…..Post…

I’ve been sitting on this post for awhile.  I had the code written weeks ago, but I’ve been procrastinating about getting the surrounding text completed.  As I’ve been trying to get the text written I’ve come up with other ideas, and instead of continually modify the code, I’ll present one solution here, and in my next post I will address one that eliminates the Project POJO.

The goal of this post is to take the nodes of the retrieved XML file from our REST call that I discussed in my early blog post and convert it into an array of concrete objects holding the XML node values as attributes.

This will be done by the following classes and interfaces

1) IObjectTranslator
2) Project
3) AbstractTranslator
3) SaxParser

The methodology discussed is one of many ways to extract objects from an XML document.  And just as a disclaimer to myself, this won’t be any ground breaking stuff, and being a Java programmer who usually has at least desktop processor and memory at his disposal, this may not be the most efficient solution for parsing an XML document on a mobile device, but nested if’s upon nest if’s are a pain to maintain in my most humble of opinions.  Okay, enough futzing around.

(more…)

published: October 1st, 2008

Android - Ruby on Rails app, setup and HttpClient hello world

OK, onto the initial post for my foray into Android and Ruby on Rails.  This basic application assumes you have Ruby on Rails 2.0 installed using MySQL and the 1.0 Android SDK.

I am by no means an expert in Ruby on Rails, and am still learning the Android API and SDK, so if any of you ninjas/rockstars/experts see something that needs correction or a better way of doing things, I’d greatly appreciate the tips.

Other posts on this subject include:

Part 2- SAX Parsing

Part 3 - Using Android Cursors

(more…)