Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Any good ORM tools for Android development? [closed]

People also ask

What is Android ORM?

An ORM stands for Object Relational Mapping and will map database tables to entities. For a Persons table for example, a class Person will be created. You will then be able to edit the fields of the class and when you call a "save" method, the database table will be updated.

What is green Dao?

greenDAO is an open source Android ORM that makes developing for SQLite databases fun again. It prevents developers from dealing with low-level database requirements and saves development time. An ORM is a layer between the relational SQLite database and the object-oriented app code.


Thought I'd just add my $0.02 here about my ORMLite package.

It is a lightweight replacement to Hibernate and uses native Android OS database calls to support SQLite on Android. It also supports many other database types using JDBC on other architectures. We have an Android mailing list for ORMLite questions.


This question cannot age but the suggested frameworks can. So, here is first a list of what I find important in such frameworks for comparison:

  • Is there a Maven or Gradle artifact? (that's a big plus depending on whether you use maven or gradle, obviously)
  • Is the code accessible in an easy way including a fast overview on commits to judge the activity? (code hosted on github is a definite plus for me, in that matter)
  • Release management: are there releases/release tags and artifacts for it? (there are some that are hosted on github and require either git clone or offer the master tarball for download - for me a big minus if not even release tags are set and addressed in the README)
  • as size matters I put up some hints where it was easy to get by (I did not download anything, so from those projects that offer no release artifacts there are no sizes)

And here is a list of frameworks with notes on the points above. I looked up some more like aBatis and Hadi but I added only those that had some activity after 2011.

  • http://ormlite.com, Maven artifact, 52 kB, SVN, the website is... difficult but there seem to be a lot of examples, according to http://ormlite.com/changelog.txt the last version is 4.48 from 2013, https://github.com/j256/ormlite-core (release tags), last activity March 2015
  • http://greendao-orm.com, good maintenance, Maven artifact, focus: fast performance, small size, little RAM consumption. Github: https://github.com/greenrobot/greenDAO/ (release tags, > 2300 stars), last activity November 2014
  • https://github.com/roscopeco/ormdroid, small size, last activity August 2014
  • http://www.activeandroid.com, https://github.com/pardom/ActiveAndroid (> 2300 stars), good maintenance, community, no release tags (download points to master tarball), Maven artifact, last activity October 2014
  • http://droidparts.org, https://github.com/yanchenko/droidparts (release tags, > 600 stars), also dependency injection, Maven artifact, actively maintained
  • http://www.androrm.com , https://github.com/androrm/androrm (release tags), last activity Jan 02, 2014 (github)
  • https://github.com/emilsjolander/sprinkles (release tags, > 600 stars), last activity May 2014, Maven artifact (thanks @AndroidGecko)
  • http://realm.io, https://github.com/realm/realm-java replaces not only ORM but also SQLite, also for iOS (release tags, > 1600 stars), actively maintained, own Maven repository

I have not tried any of those but maybe I can spare current readers a bit of time by listing the nowadays active projects. Please add a comment if you know of other projects that satisfy some of the above points and have some serious development (over some time) going on.

EDIT (2013 Nov): updated the list to the current status of the projects. Some of these have added release tags to their github repos as well as Maven/Gradle support. Good work!

EDIT (2015 Apr): updated the list, added Sprinkles (as per comment by @AndroidGecko) and Realm.io.


If performance and code size matter, check out greenDAO. I'm the author of it, and my motivation to create another ORM was to avoid reflection in the hotspots. It turned out that greenDAO can be up to 4 times faster than ORMLite. Checkout the feature page for details.


I don't know of anything that is exactly what you are asking for, but there is an alternative to SQLite that you may find useful if your architecture requirements are flexible. It may be worth checking out db4o:

  • Android db4o
  • Code comparison examples