当前位置: 首页 > 工具软件 > Sugar Oshi > 使用案例 >

android数据库--sugar

周飞语
2023-12-01

非常实用的数据库第三方依赖

项目地址: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

https://github.com/greenrobot/greenDAO

https://github.com/realm/realm-java

 类似资料: