Thursday, 12 September 2013

Android ContentProvider vs ORMLite

Android ContentProvider vs ORMLite

I'm using content provider to manage my application data, which is not
shared with other applications. However, there is some boilerplate code
such as translating the cursor to domain object. ORMLite provides a more
elegant way that mapping the database entry to domain object directly. So
I want to replace the content provider with ORMlite. But I have some
worry: 1. The content provider works fine in the multiple threads
environment. I don't know whether the ORMlite is thread-safe. 2. The
content provider can broadcast the database change. I don't know whether
the ORMLite has this kind of support. 3. Android provider some utilities
such as AsynQueryHandler, CursorLoader to do the asynchronusly query the
database. If I use ORMLite, I have to explicitly create a thread or
AsyncTask to do the query.
whether I should replace the content provider with ORMLite ?

1 comment:

  1. Hi Jaini. Please take a look at https://github.com/blandware/android-atleap library. Probably it could help you to work with ORMLite and ContentProvider simultaneously.

    ReplyDelete