Android: access SQLite database via Content Provider or implement DAO?

user1135437 picture user1135437 · Nov 24, 2012 · Viewed 15.3k times · Source

I'm wondering which is the best approach to access my application database: use a Content Provider, or implement my DAO by hand? From my latest investigations, seems that Content Provider, even for app internal use, is preferable, but I don't know exactly what are the drawbacks of each approach. Can you give some feedback about this?

Answer

Labeeb Panampullan picture Labeeb Panampullan · Nov 24, 2012

I prefer to use ContentProvider if you have concerns of closing or locking of db. Check Simple Content Provider for db operations