Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Choosing an ORM for Android project (min. API level 7) [closed]

I currently have an application, where it's primary performance issue is using file-based database consisted of JSON responses.

I'd like to rewrite my application to use SQLite database feature.
Since I'm lazy, I'd like to use some kind of ORM.

So far I have found only two big ORM libraries:

  • ORMLite
  • GreenDAO ORM
  • DB4O
  • ActiveAndroid

My primary goal is to raise performance on working with data as much as possible

But I've found two possible issues with those libraries.

  • ORMLite uses annotations, which is big performance issue in pre-honeycomb due to this bug

  • GreenDAO is using some kind of code generator, and that would slow me down on development as I would have to write generator, and then use generated code. And I don't very like this idea.

  • DB4O is JPA, which I've always considered as slow and heavy on memory usage, therefore unsuitable for low-end devices (remember the Android API v7)


ad @ChenKinnrot:
The estimated load should be sufficient to think about using an ORM.
In my case it is about 25-30 unique tables, and at least 10 table joins (2 - 4 tables at a time). About 300-500 unique fields (columns)


So my questions are:

  1. Should I use ORM/JPA layer in Android application?
  2. If so, what library would you recommend me to use? (and please add some arguments too)
like image 264
Marek Sebera Avatar asked Jul 13 '12 14:07

Marek Sebera


1 Answers

I've used ORMLite and found it straightforward once you got the hang of it (a few hours), quite powerful and didn't cause any performance problems (app tested in Gingerbread on HTC desire and HTC Hero).

I will be using it again in any projects I need to use a DB for.

like image 78
cjk Avatar answered Oct 03 '22 14:10

cjk