Save User State

Sep 10 2024 · Kotlin 1.9, Android 14, Android Studio Koala | 2024.1.1

Lesson 04: Define a Room Database

Demo

Episode complete

Play next episode

Next

Heads up... You’re accessing parts of this content for free, with some sections shown as obfuscated text.

Heads up... You’re accessing parts of this content for free, with some sections shown as obfuscated text.

Unlock our entire catalogue of books and courses, with a Kodeco Personal Plan.

Unlock now

Now, you’ll learn how to define a Room Database for your notes.

id 'com.google.devtools.ksp' version '1.9.23-1.0.20' apply false
id 'com.google.devtools.ksp'
implementation "androidx.room:room-ktx:2.6.1"
ksp "androidx.room:room-compiler:2.6.1"
import androidx.room.Database
import androidx.room.RoomDatabase

@Database(version = 1)
abstract class DevScribeDatabase: RoomDatabase() {
}
val roomDatabaseModule = module {
  single {
    Room.databaseBuilder(androidContext(), DevScribeDatabase::class.java, "dev_scribe_db")
      .build()
  }
}
See forum comments
Cinema mode Download course materials from Github
Previous: Instruction Next: Conclusion