Android Jetpack 104

ROOM + Coroutine Flow - 4 (Why Room & Coroutine - 2)

Flow를 이용해서 데이터 변화를 감지해보겠습니다. id 'kotlin-kapt' // ROOM def roomVersion = "2.5.0" implementation("androidx.room:room-runtime:$roomVersion") annotationProcessor("androidx.room:room-compiler:$roomVersion") // To use Kotlin annotation processing tool (kapt) kapt("androidx.room:room-compiler:$roomVersion") // Coroutine implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.6.4") // Corouti..

Android Jetpack 2023.01.28

ROOM + Coroutine Flow - 3 (Why Room & Coroutine - 1)

이곳부터 한번 보고 가겠습니다. https://medium.com/androiddevelopers/room-flow-273acffe5b57 Room 🔗 Flow Coroutines support in Room has been increasing at every release: Room 2.1 added coroutines support for one-shot read / write operations and… medium.com 여기를 읽어보면 데이터의 변동사항을 관찰하기 위해 Flow를 사용한다라고 적혀있습니다. 그렇다면 Flow를 사용하고 사용하지 않고 어떤 것이 다를까요? 간단한 예제를 통해서 한번 살펴보겠습니다. Flow를 사용하지 않고 앱을 만들었을 때 코드는 아래와 같고 GETDATA를 눌러야..

Android Jetpack 2023.01.27