본문
180326(화) - Android Architecture Components (Adding components to Project)
Architecture/MVVM 2018. 3. 27. 19:31
Android Architecture Components
Adding components to Project
※ build.gradle project level (not app or module)
allprojects {
repositories {
jcenter()
google()
}
}
Add Architecture Components
※ Kotlin 사용시, annotationProcessor -> kapt
Main Dependencies
dependencies {
// ViewModel and LiveData
implementation "android.arch.lifecycle:extensions:1.1.1"
// alternatively, just ViewModel
implementation "android.arch.lifecycle:viewmodel:1.1.1"
// alternatively, just LiveData
implementation "android.arch.lifecycle:livedata:1.1.1"
annotationProcessor "android.arch.lifecycle:compiler:1.1.1"
// Room (use 1.1.0-beta1 for latest beta)
implementation "android.arch.persistence.room:runtime:1.0.0"
annotationProcessor "android.arch.persistence.room:compiler:1.0.0"
// Paging
implementation "android.arch.paging:runtime:1.0.0-alpha7"
// Test helpers for LiveData
testImplementation "android.arch.core:core-testing:1.1.1"
// Test helpers for Room
testImplementation "android.arch.persistence.room:testing:1.0.0"
}
Java 8 Support for Lifecyclesdependencies {
// Java8 support for Lifecycles
implementation "android.arch.lifecycle:common-java8:1.1.1"
}
Optional Dependencies for RxJava and ReactiveStreamsdependencies {
// RxJava support for Room (use 1.1.0-beta1 for latest alpha)
implementation "android.arch.persistence.room:rxjava2:1.0.0"
// ReactiveStreams support for LiveData
implementation "android.arch.lifecycle:reactivestreams:1.1.1"
}
Optional Dependencies for Guava
dependencies {
// Guava support for Room
implementation "android.arch.persistence.room:guava:1.1.0-beta1"
}
Alternative import for lightweight Lifecycles only
dependencies {
// Lifecycles only (no ViewModel or LiveData)
implementation "android.arch.lifecycle:runtime:1.1.1"
annotationProcessor "android.arch.lifecycle:compiler:1.1.1"
}
'Architecture > MVVM' 카테고리의 다른 글
180328(목) - Android Architecture Components (LiveData) (0) | 2018.03.29 |
---|---|
180328(수) - Android Architecture Components (Handling Lifecycles) (0) | 2018.03.28 |
180322(목) - Android Architecture Component (Guide to App Architecture) (0) | 2018.03.23 |
180322(목) - Architecture Component (Adding Components to your Project) (0) | 2018.03.22 |
180322(목) - MVVM & AAC (0) | 2018.03.22 |
댓글