Best practices for SQLite DB and ContentProvider

后端 未结 5 1755
借酒劲吻你
借酒劲吻你 2021-01-29 22:42

My Android app is reading and writing to a local SQLite DB from a few different Activities and a Service. Pretty standard. But I\'m not happy with the way I\'ve got all the DB d

5条回答
  •  攒了一身酷
    2021-01-29 23:13

    We have been tuning ORMLite on Android for a while now and it is working well. ORMLite supports Android with native database calls and also supports other databases via JDBC. You annotate your classes/fields and use base DAO classes to persist to SQLite.

    • CREATE TABLE statements are handled my ORMLite's utility classes. Most SQL is taken care of by the DAO classes.
    • The Android section of the online documentation explains the class hierarchy. You implement a DatabaseHelper which helps create an update your database. Your activities extend OrmLiteBaseActivity (or service or tab) which gives access to helper and DAOs.
    • ORMLite does not provide a solution for merging with remote REST servers.

    Hope this is somewhat helpful.

提交回复
热议问题