Last active
May 24, 2021 20:54
-
-
Save barbeau/950774f52dea3c6c07b36cfd1c0cd113 to your computer and use it in GitHub Desktop.
Medium article - Room + Flow for location updates - app
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
... | |
// New plugins for Room | |
apply plugin: 'kotlin-kapt' | |
apply plugin: 'dagger.hilt.android.plugin' | |
android { | |
... | |
defaultConfig { | |
... | |
// Export the Room schema to the /schemas directory so we can track changes across database versions | |
javaCompileOptions { | |
annotationProcessorOptions { | |
arguments += ["room.schemaLocation": "$projectDir/schemas".toString()] | |
} | |
} | |
} | |
} | |
dependencies { | |
... | |
// To launch co-routines within the Service to store location data in Room and observe the Room Flow in the Activity | |
def lifecycle_version = "2.4.0-alpha01" | |
implementation "androidx.lifecycle:lifecycle-runtime-ktx:$lifecycle_version" | |
implementation "androidx.lifecycle:lifecycle-service:$lifecycle_version" | |
// Room for storing location data and observing it via Flow | |
def room_version = "2.3.0" | |
implementation "androidx.room:room-runtime:$room_version" | |
kapt "androidx.room:room-compiler:$room_version" | |
implementation "androidx.room:room-ktx:$room_version" | |
// Hilt for dependency injection | |
implementation "com.google.dagger:hilt-android:$hilt_version" | |
kapt "com.google.dagger:hilt-compiler:$hilt_version" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment