Android Room Database explained with Code! | Android Jetpack

Опубликовано: 27 Октябрь 2024
на канале: Ludwig Dickmanns
1,291
43

Kotlin Tutorial on Android Room Database!

As part of Android Jetpack, Room provides an abstraction layer on top of the SQLite database. While SQLite offers powerful, low-level access, it comes with a few drawbacks: you don't get compile-time query check, and, being a low-level API, it is error-prone to use and requires a lot of boilerplate code. Room, in contrast, has a much easier-to-use API, which makes heavy use of Annotations to keep your files simple and easy to maintain. It also offers compile-time query checks and high testability. Furthermore, Room supports observable queries, which helps with reactive programming. Finally, you won't be blocking the UI thread with Room because it throws an exception if you try to access the database from the UI thread.

Timestamps:
00:00 Intro
00:25 SQLite
00:44 Room Database
01:25 Room Components
02:02 Example: Explanation
02:17 Gradle Dependencies
03:01 Entity
03:46 DAO
04:46 Type Converters
05:25 Database
06:17 Testing
07:18 Outro