livedata and viewmodel dependency

Solutions on MaxInterview for livedata and viewmodel dependency by the best coders in the world

showing results for - "livedata and viewmodel dependency"
Nicole
26 Jan 2020
1dependencies {
2    def lifecycle_version = "2.2.0"
3    def arch_version = "2.1.0"
4
5    // ViewModel
6    implementation "androidx.lifecycle:lifecycle-viewmodel:$lifecycle_version"
7    // LiveData
8    implementation "androidx.lifecycle:lifecycle-livedata:$lifecycle_version"
9    // Lifecycles only (without ViewModel or LiveData)
10    implementation "androidx.lifecycle:lifecycle-runtime:$lifecycle_version"
11
12    // Saved state module for ViewModel
13    implementation "androidx.lifecycle:lifecycle-viewmodel-savedstate:$lifecycle_version"
14
15    // Annotation processor
16    annotationProcessor "androidx.lifecycle:lifecycle-compiler:$lifecycle_version"
17    // alternately - if using Java8, use the following instead of lifecycle-compiler
18    implementation "androidx.lifecycle:lifecycle-common-java8:$lifecycle_version"
19
20    // optional - helpers for implementing LifecycleOwner in a Service
21    implementation "androidx.lifecycle:lifecycle-service:$lifecycle_version"
22
23    // optional - ProcessLifecycleOwner provides a lifecycle for the whole application process
24    implementation "androidx.lifecycle:lifecycle-process:$lifecycle_version"
25
26    // optional - ReactiveStreams support for LiveData
27    implementation "androidx.lifecycle:lifecycle-reactivestreams:$lifecycle_version"
28
29    // optional - Test helpers for LiveData
30    testImplementation "androidx.arch.core:core-testing:$arch_version"
31}
32
Erica
23 Mar 2019
1// ViewModel and LiveData
2implementation "androidx.lifecycle:lifecycle-extensions:$lifecycle_version"
3// alternatively - just ViewModel
4implementation "androidx.lifecycle:lifecycle-viewmodel:$lifecycle_version" // For Kotlin use lifecycle-viewmodel-ktx
5// alternatively - just LiveData
6implementation "androidx.lifecycle:lifecycle-livedata:$lifecycle_version"
7// alternatively - Lifecycles only (no ViewModel or LiveData). Some UI
8//     AndroidX libraries use this lightweight import for Lifecycle
9implementation "androidx.lifecycle:lifecycle-runtime:$lifecycle_version"
10
11annotationProcessor "androidx.lifecycle:lifecycle-compiler:$lifecycle_version" // For Kotlin use kapt instead of annotationProcessor
12// alternately - if using Java8, use the following instead of lifecycle-compiler
13implementation "androidx.lifecycle:lifecycle-common-java8:$lifecycle_version"
14
15// optional - ReactiveStreams support for LiveData
16implementation "androidx.lifecycle:lifecycle-reactivestreams:$lifecycle_version" // For Kotlin use lifecycle-reactivestreams-ktx
17
18// optional - Test helpers for LiveData
19testImplementation "androidx.arch.core:core-testing:$lifecycle_version"
20
queries leading to this page
android live data dependencyandroid view model dependencyandroid viewmodel dependency injectioncycle library androiddependency lifecycle viewmodelviewmodel and livedata example androidviewmodel and livedata implementationandroidx lifecycle 3alifecycle extensions 3alifecycle library kotlinlifecycle version androidlifecycle library androidviewmodel dependency andandroid viewmodel dependencyimport androidx lifecycle viewmodel how to importandroid livedata inviewmodelandroid viewmodel dependencyviewmodel dependency android studioviewmodel dependenciesdependency to view lifecycle androidlivedata and viewmodel in androidandroid arch lifecycle dependencyandroid viewmodel importlivedata with viewmodel android exampleimport android arch lifecycle livedataandroid java viewmodellifecycle extensions androidviewmodel livedatajetpack dependenciesandroid viewmodel lifecycle kotlin implementationandroid arch lifecycle 3acompiler 3aandroid viewmodelandroid viewmodel implementation gradleandroidx lifecycle dependency implementation 22androidx lifecycle 3alifecycle viewmodel 3a 24rootproject lifecycleversion 22 how to add viewmodel and livedata library in app kotlin dependencyandroid viewmodel implementation gradle extensionsviewmodal dependency for androidimplementation 22androidx lifecycle 3alifecycle viewmodel ktxlifecycle android dependencyview model dependencyviewmodel dependency injectionandroid livedata viewmodel exampleandroid lifecycle importslifecycle library kotlinandroidx lifecycle 3alifecycleadding dependency for viewmodel androidlivedata viewmodelimplementation viewmodel android studiolive data dependenciesdependencies for lifecycle including livedata and viewmodelandroid lifecycle dependencyviewmodel dependency androidlivedata viewmodel tutorial javalivedata dependency in androidxadding viewmodel andoridlive data dependency for androidandroidx lifecycle 3alifecycle extensionsandroid viewmodel dependency javaviewmodel and livedata android dependencyimport androidx lifecycle livedatadependecy for viewmodel and livedatalivedata implementation gradleandroid view model dependency kotlinviewmodel android studioadding dependency in viewmodel androidlivedata and viewmodel androidandroid lifecycle extensions dependencyimplementation 22androidx lifecycle 3alifecycle viewmodel 3a 24rootproject lifecycle version 22lifecycle components dependencyviewmodel library and livedata dependencylifecycle extension androidandroid viewmode importimport viewmodel androidlivedata dependencieslifecycle viewmodel dependencyandroid viewmodel in viewmodellifecycle livedata viewmodel dependencyandroidx lifecycle 3alifecycle viewmodel ktxview model dependency in androidlifecycle dependency androidkapt 22androidx lifecycle 3alifecycle compiler 3a 24lifecycle version 22android inject viewmodelandroid dependencies lifecycleview model android dependenciesviewmodel dependencyviewmodel library androidgradle how to implement viewmodelandroid lifecycle importlivedata library and viewmodel dependencyandroid viewmodelinjectviewmodel library and livedata dependency javainject viewmodel androidandroid viewmodel implementationandroid lifecycle implementationlivedata implementationview model dependency kotlinandroidx lifecycleandroidx lifecycle purposelivedata and viewmodel dependencyviewmodel and livedata dependencyandroidx lifcyleviewmodels android dependencyandroid viewmodel and livedata dependencyandroid arch lifecycle extensions gradleinject viewmodel dependenciesandroid viewmodel libraryandroidx lifecycle extensions dependencyviewmodel dependency android kotlinandroid java viewmodel dependencyandroid viewmodel dependency versionsdependency to use viewmodel android mvvmmvvm android dependency purpose androidx lifecyclelivedata in viewmodel androidviewmodel and livedata dependency for android in javalivedata and viewmodel dependency