当前位置:网站首页>Android room database quick start
Android room database quick start
2022-04-23 07:10:00 【Bao Guo】
What is? Android Room database ?
Android Room yes Google Published a and SQLite Related databases , It's a lightweight ORM(Object Relational Mapping) Object relational mapping database , It's essentially right Android Native SQLite Encapsulation , It's just relatively simpler than the native operation 、 Efficient , At present, there are similar databases on the market GreenDao、LitePal、Realm、ObjectBox wait .
Why use Android Room database ?
because Android Room Database has the following advantages over other databases :
1、SQL Queries are validated at compile time ( Each... Is checked at compile time @Query and @Entity Whether the grammar is wrong , Whether the corresponding table exists, etc ), You don't have to wait until after running to query for errors , This can improve work efficiency .
2、 Less code
3、 And LiveData Integrate
How do you use it? Android Room database ?
Running environment :
AndroidStudio 4.2.2
Specific use steps :
1、 First in the project /app/build.gradle In the document dependencies Add the following dependencies to the object :
implementation "androidx.room:room-runtime:2.3.0"
annotationProcessor "androidx.room:room-compiler:2.3.0"
版权声明
本文为[Bao Guo]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204230605542495.html
边栏推荐
猜你喜欢

Itop4412 HDMI display (4.4.4_r1)

iTOP4412 LCD背光驱动(PWM)

取消远程依赖,用本地依赖

OSS云存储管理实践(体验有礼)

ffmpeg常用命令

Using Prom label proxy to implement label based multi tenant reading of Prometheus thanos

Itop4412 HDMI display (4.0.3_r1)

Implementation of multi tenant read and write in Prometheus cortex

Itop4412 LCD backlight drive (PWM)

oracle通过触发器和序列来定义自增主键,并且设置定时任务每秒钟插入一条数据到目标表
随机推荐
Oracle索引状态查询与索引重建
RAC环境报错ORA-00239: timeout waiting for control file enqueue排查
Itop4412 HDMI display (4.4.4_r1)
oracle对表字段的修改
Abnormal record-19
Tiny4412 HDMI显示
Dolphinscheduler配置Datax踩坑记录
组件化学习
19C中ASM network未自动启动的处理
记录webView显示空白的又一坑
Research on alertmanager repeated / missing alarm phenomenon and two key parameters_ Wait and group_ Interpretation of interval
oracle存储过程中is和as区别
组件化学习(3)ARouter中的Path和Group注解
Abnormal record-21
MarkDown基础语法笔记
开篇:双指针仪表盘的识别
iTOP4412 HDMI显示(4.4.4_r1)
Prometheus monitoring method and index interpretation of influxdb
[SM8150][Pixel4]LCD驱动
常用于融合去重的窗口函数row_number