So the majority of the code for my presentation at AndroidTO is up and hosted on Github.

If you are looking for a tutorial on how to interact with SQLite on Android, check out my code. It’s fairly straightforward though almost completely undocumented. I’ll go through in the next few weeks while working on the presentation and add comments to the code both for JavaDocs as well as explaining the nuances of what I was thinking while writing the stuff.

This is probably my fourth or fifth time writing code to interact with databases on Android and I must say that it is a huge pain in the ass. Having to write much of the SQL by hand is error prone, tedious, and downright annoying. It would be nice if the Android SDK came with a built in persistence layer like how iOS comes with CoreData baked into it. It would allow you to focus on the problem at hand instead of wasting that time on the boilerplate copypasta.

I have looked into some ORMs for Android and so far it appears fairly sparse. There are Java libraries you can bring over, though I’m not entire sure how compatible or efficient they are. Hibernate is clearly out of the picture. I have found one project Active Android that seems to be kinda neat, which I am working on using for an app I’m working on. Unfortunately it’s commercially licensed, though it’s rather inexpensive.

If you are looking for an open source tool there is one project called sqlitegen that uses Java annotations and code generation to build to data access classes for you. I haven’t used it personally since I’d prefer to use a solution that doesn’t rely on Eclipse.

© 2011 Christopher Saunders Suffusion theme by Sayontan Sinha