非常实用的数据库第三方依赖
项目地址:https://github.com/chennaione/sugar
亲测非常实用。
一些注意事项:
1,数据库配置
<meta-data
android:name="DATABASE"
android:value="sugar_example.db" /><!-- 数据库名称 -->
<meta-data
android:name="VERSION"
android:value="2" /><!-- 数据库版本号,用来更新表字段 -->
<meta-data
android:name="QUERY_LOG"
android:value="true" /><!-- 显示日志 -->
2,必须重新他的application (SugarApp )
public class MyAPP extends SugarApp {
@Override
public void onCreate() {
super.onCreate();
}
}
其他数据库:
https://github.com/LitePalFramework/LitePal