Android开发常用的依赖

Rxjava 依赖

RxAndroid 依赖

implementation "io.reactivex.rxjava2:rxjava:2.2.10"
implementation 'io.reactivex.rxjava2:rxandroid:2.1.1'

GreenDao 依赖

mavenCentral() // add repository
classpath 'org.greenrobot:greendao-gradle-plugin:3.2.2' // add plugin
apply plugin: 'org.greenrobot.greendao' // apply plugin
dependencies {
    implementation 'org.greenrobot:greendao:3.2.2' // add library
}

OkHttp 依赖

compile 'com.squareup.okhttp3:okhttp:3.11.0'

Retrofit依赖

implementation 'com.squareup.retrofit2:retrofit:2.4.0'
implementation 'com.squareup.retrofit2:converter-gson:2.4.0' // 可选依赖,解析json字符所用
implementation 'com.squareup.retrofit2:adapter-rxjava2:2.6.0'

Banner开源框架介绍 // banner 轮播图

implementation'com.youth.banner:banner:1.4.10'
implementation "com.github.bumptech.glide:glide:3.7.0"//支持图片

中文

android.enableAapt2=false

网络 jar包 需联网下载

  implementation 'com.google.code.gson:gson:2.2.4'

侧滑菜单,TabLayout依赖

  implementation 'com.android.support:design:27.1.1'

recyclerview 依赖

    implementation 'com.android.support:recyclerview-v7:27.1.1'

xrecyclerview

    implementation 'com.jcodecraeer:xrecyclerview:1.5.9'

SmartRefreshHeader

implementation 'com.scwang.smartrefresh:SmartRefreshLayout:1.1.0-alpha-30'
implementation 'com.scwang.smartrefresh:SmartRefreshHeader:1.1.0-alpha-30'

TabLayout依赖 顶部标题栏

    implementation 'com.android.support:design:27.1.1'

butterknife 依赖

implementation 'com.jakewharton:butterknife:8.8.1'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'

AndroidAnnotations 依赖

annotationProcessor "org.androidannotations:androidannotations:4.6.0"

implementation "org.androidannotations:androidannotations-api:4.6.0"

Glide 依赖

implementation 'com.github.bumptech.glide:glide:4.9.0'

annotationProcessor 'com.github.bumptech.glide:compiler:4.9.0'

fresco 依赖

implementation 'com.facebook.fresco:fresco:1.12.0'

卡片布局

    implementation 'com.android.support:cardview-v7:27.1.1'

图片框架依赖

    implementation 'com.github.bumptech.glide:glide:3.7.0'

    implementation 'com.squareup.picasso:picasso:2.3.2'

解决依赖冲突

configurations.all {
        resolutionStrategy.eachDependency { DependencyResolveDetails details ->
            def requested = details.requested
            if (requested.group == 'com.android.support') {
                if (!requested.name.startsWith("multidex")) {
                     details.useVersion '27.1.1'
                }
            }
        }
    }

butterknife

implementation 'com.jakewharton:butterknife:5.1.1'

//下面需要放到defaultConfig 里 //ButterKnife框架报错解决

javaCompileOptions { annotationProcessorOptions { includeCompileClasspath = true } }

build 文件中  android 下 添加

sourceSets { main { assets.srcDirs = ['src/assets', 'src/assets/'] } }

你可能感兴趣的:(Android开发常用的依赖)