Android Project Setup

1.add java 8
compileOptions{
    sourceCompatibility JavaVersion.VERSION_1_8
    targetCompatibility JavaVersion.VERSION_1_8
}
2.required dependency
//recycler view
implementation 'androidx.recyclerview:recyclerview:1.1.0'
//retrofit
implementation 'com.squareup.retrofit2:retrofit:2.4.0'
implementation 'com.squareup.retrofit2:converter-gson:2.4.0'
//jetPack component
def lifecycle_version = "2.2.0"
//viewModel+liveData
implementation "androidx.lifecycle:lifecycle-extensions:$lifecycle_version"
// Annotation processor(only for java 8)
//annotationProcessor "androidx.lifecycle:lifecycle-compiler:$lifecycle_version"
implementation "androidx.lifecycle:lifecycle-common-java8:$lifecycle_version"
//paging
implementation 'androidx.paging:paging-runtime:3.0.0-alpha06'

Folder Structure

top