当前位置:网站首页>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
边栏推荐
猜你喜欢

Dolphinscheduler源码包src.tar.gz解压问题

Itop4412 HDMI display (4.4.4_r1)

双指针仪表盘读数(一)

ViewPager2实现画廊效果执行notifyDataSetChanged后PageTransformer显示异常 界面变形问题

Encapsulate a set of project network request framework from 0

Static interface method calls are not supported at language level ‘5‘ 异常解决

Itop4412 HDMI display (4.0.3_r1)

iTOP4412 LCD背光驱动(PWM)

统一任务分发调度执行框架

Build a cloud blog based on ECS (polite experience)
随机推荐
记录webView显示空白的又一坑
Recyclerview 批量更新View:notifyItemRangeInserted、notifyItemRangeRemoved、notifyItemRangeChanged
Apache Atlas 编译及安装记录
杂七杂八的学习
C#新大陆物联网云平台的连接(简易理解版)
iTOP4412 HDMI显示(4.4.4_r1)
[sm8150] [pixel4] LCD driver
oracle对表字段的修改
oracle通过触发器和序列来定义自增主键,并且设置定时任务每秒钟插入一条数据到目标表
Abnormal record-12
mysql和pgsql时间相关操作
pg库对姓名进行校验
"Write multi tenant" implementation of Prometheus and thanos receiver
AVD Pixel_2_API_24 is already running.If that is not the case, delete the files at C:\Users\admi
Apache SeaTunnel 2.1.0部署及踩坑
RAC环境集群组件gipc无法正确识别心跳网络状态问题分析
Abnormal record-17
Build an OSS based image sharing website - polite feedback
Itop4412 surfaceflinger (4.4.4_r1)
通过rownum来进行区间查询