Android Tutorial 2019 #10: Room Database w/ Kotlin Coroutines | Entity, DAO, Query, Insert

Опубликовано: 13 Октябрь 2024
на канале: Ryan Michael Kay
16,057
308

Source code:
https://github.com/BracketCove/Jetpac...

Master OOP languages with tutorials from someone who actually cares if you understand how to write beautiful code:
Java Desktop Programming w/ JavaFX (Intermediate) - https://skl.sh/31pzCa1
Complete Beginner Introduction To Java Programming (Beginner - Intermediate) - https://skl.sh/3fZbjos
Android Apps With Kotlin & Android Studio (Beginner) - https://skl.sh/2ZU6ZT9
Material Design Android Programming w/ Kotlin (Intermediate) - https://skl.sh/2OrwrYZ

All the above courses are available for 2.99 a month via a youtube subscription to this channel too!

  / rkay301  
  / wiseassblog  
  / wiseass301  
rkay301.medium.com/follow

In this part of my 2019 Android tutorial, we set up a Room Database using Kotlin Coroutines instead of LiveData. While I do like to use LiveData in the front end of my Android Apps, I do not like to use it in the domain (middle) and back end of my Apps. In this tutorial, I show you how to set up Room in a way which keeps your application Clean, while keeping your Insert, Query, Update, and Delete operations from blocking the main thread.

The best part is that all we need to do to achieve this, is add the suspend keyword to a couple of functions, and everything is all set!