美文网首页
Android 3rd party libs by functi

Android 3rd party libs by functi

作者: insomniatt | 来源:发表于2017-06-27 17:26 被阅读49次

    1.网络 http support

    okhttp3

        /*http support*/
        compile 'com.squareup.okhttp3:okhttp:3.7.0'
        compile 'com.squareup.okhttp3:logging-interceptor:3.7.0'
    

    retrofit2

        /*restful support*/
        compile 'com.squareup.retrofit2:retrofit:2.2.0'
        compile 'com.squareup.retrofit2:converter-gson:2.2.0'
        compile 'com.squareup.retrofit2:adapter-rxjava2:2.2.0'
    

    2.面向过程, 链式编程,多线程间通信 rx support

    rxjava2

        /*rxjava2 support*/
        compile 'io.reactivex.rxjava2:rxjava:2.1.0'
        compile 'io.reactivex.rxjava2:rxandroid:2.0.1'
    

    3.M 以上权限问题 permission support

    rxpermission

        /*permission support*/
        compile 'com.tbruyelle.rxpermissions2:rxpermissions:0.9.4@aar'
    

    4.图片获取三级缓存方案 imageloader support

    fresco

        /*imageloader support*/
        compile 'com.facebook.fresco:fresco:1.3.0'
        compile 'com.facebook.fresco:imagepipeline-okhttp3:1.3.0'
        compile 'com.facebook.fresco:animated-gif:1.3.0'
    

    glide

      //glide
      compile "com.github.bumptech.glide:glide:$glide_version"
    

    imageLoader

    5.jake 出品必属精品

    rxbinding

        /*rxbinding support*/
        compile 'com.jakewharton.rxbinding2:rxbinding:2.0.0'
        compile 'com.jakewharton.rxbinding2:rxbinding-support-v4:2.0.0'
        compile 'com.jakewharton.rxbinding2:rxbinding-appcompat-v7:2.0.0'
        compile 'com.jakewharton.rxbinding2:rxbinding-recyclerview-v7:2.0.0'
        compile 'com.jakewharton.rxbinding2:rxbinding-design:2.0.0'
    

    butterknife

      compile 'com.jakewharton:butterknife:8.5.1'
    annotationProcessor 'com.jakewharton:butterknife-compiler:8.5.1'
    

    6.依赖注入 DI dagger2

        compile 'com.google.dagger:dagger:2.11-rc2'
        compile 'com.google.dagger:dagger-android:2.11-rc2'
        compile 'com.google.dagger:dagger-android-support:2.11-rc2' 
    
        annotationProcessor 'com.google.dagger:dagger-android-processor:2.10'
        annotationProcessor 'com.google.dagger:dagger-compiler:2.11-rc2'
    

    7.android router

    compile 'com.alibaba:arouter-api:1.2.1.1'
    annotationProcessor 'com.alibaba:arouter-compiler:1.1.2.1'
    

    8.代码编译时错误检查 error prone

    compile 'com.google.errorprone:error_prone_annotations:2.0.19'
    

    9.pretty log

    logger

    compile 'com.orhanobut:logger:1.15'
    

    timber

      //timber
      compile "com.jakewharton.timber:timber:$timber_version"
    

    10.eventbus

    11.数据库

    greendao

    12.lifecycle

    13.bluetooth

    14.加载动画

    15.自定义 lifecycle, 解决 rxjava 内存泄漏

    其实RxJava引起的内存泄漏, RxJava作为一种响应式编程框架,是目前编程界网红,可谓是家喻户晓,其简洁的编码风格、易用易读的链式方法调用、强大的异步支持等使得RxJava被广泛使用,它通过线程调度器更容易控制和切换线程,如果该工作线程还没执行结束就退出Activity或者Fragment,就会Activity或者Fragment无法释放引起内存泄漏。

    rxlifecycle

        compile 'com.trello.rxlifecycle2:rxlifecycle:2.0.1'
    

    16.Android Architecture Components: 一个新的库集合,帮助您设计健壮的、可测试的和可维护的应用程序。从管理UI组件生命周期和处理数据持久性开始。

    allprojects {
     repositories {
         jcenter()
         maven { url 'https://maven.google.com' }
     }
    }
    
    //For Lifecycles, LiveData, and ViewModel, add:
    compile "android.arch.lifecycle:runtime:1.0.0-alpha1"
    compile "android.arch.lifecycle:extensions:1.0.0-alpha1"
    annotationProcessor "android.arch.lifecycle:compiler:1.0.0-alpha1"
    //For Room, add:
    compile "android.arch.persistence.room:runtime:1.0.0-alpha1"
    compile "android.arch.persistence.room:rxjava2:$rootProject.architectureComponentsVersion"
    annotationProcessor "android.arch.persistence.room:compiler:1.0.0-alpha1"
    

    17.test

     //test
        // Dependencies for local unit tests
        testCompile "junit:junit:$rootProject.ext.junitVersion"
        testCompile "org.mockito:mockito-all:$rootProject.ext.mockitoVersion"
        testCompile "org.hamcrest:hamcrest-all:$rootProject.ext.hamcrestVersion"
        testCompile "android.arch.core:core-testing:$rootProject.architectureComponentsVersion"
      testCompile "com.squareup.okhttp3:mockwebserver:$mockwebserver_version"
      testCompile("android.arch.core:core-testing:$arch_version", {
        exclude group: 'com.android.support', module: 'support-compat'
        exclude group: 'com.android.support', module: 'support-annotations'
        exclude group: 'com.android.support', module: 'support-core-utils'
      })
    
        // Android Testing Support Library's runner and rules
        androidTestCompile "com.android.support.test:runner:$rootProject.ext.runnerVersion"
        androidTestCompile "com.android.support.test:rules:$rootProject.ext.runnerVersion"
        androidTestCompile "android.arch.persistence.room:testing:$rootProject.architectureComponentsVersion"
        androidTestCompile "android.arch.core:core-testing:$rootProject.architectureComponentsVersion"
    
        // Dependencies for Android unit tests
        androidTestCompile "junit:junit:$rootProject.ext.junitVersion"
        androidTestCompile "org.mockito:mockito-core:$rootProject.ext.mockitoVersion"
        androidTestCompile 'com.google.dexmaker:dexmaker:1.2'
        androidTestCompile 'com.google.dexmaker:dexmaker-mockito:1.2'
    
        // Espresso UI Testing
        androidTestCompile "com.android.support.test.espresso:espresso-core:$rootProject.espressoVersion"
        androidTestCompile "com.android.support.test.espresso:espresso-contrib:$rootProject.espressoVersion"
        androidTestCompile "com.android.support.test.espresso:espresso-intents:$rootProject.espressoVersion"
    
    // Resolve conflicts between main and test APK:
        androidTestCompile "com.android.support:support-annotations:$rootProject.supportLibraryVersion"
        androidTestCompile "com.android.support:support-v4:$rootProject.supportLibraryVersion"
        androidTestCompile "com.android.support:appcompat-v7:$rootProject.supportLibraryVersion"
        androidTestCompile "com.android.support:design:$rootProject.supportLibraryVersion"
    
      androidTestCompile "com.android.support:appcompat-v7:$support_version"
      androidTestCompile "com.android.support:recyclerview-v7:$support_version"
      androidTestCompile "com.android.support:support-v4:$support_version"
      androidTestCompile "com.android.support:design:$support_version"
      androidTestCompile("com.android.support.test.espresso:espresso-core:$espresso_version", {
        exclude group: 'com.android.support', module: 'support-annotations'
        exclude group: 'com.google.code.findbugs', module: 'jsr305'
      })
      androidTestCompile("com.android.support.test.espresso:espresso-contrib:$espresso_version", {
        exclude group: 'com.android.support', module: 'support-annotations'
        exclude group: 'com.google.code.findbugs', module: 'jsr305'
      })
      androidTestCompile("android.arch.core:core-testing:$arch_version", {})
      androidTestCompile "org.mockito:mockito-android:$mockito_version"
    

    18. dataBinding

      dataBinding {
        enabled = true
      }
    

    19. Support Libraries

    // Support Libraries
        compile 'com.android.support:appcompat-v7:25.3.1'
        compile 'com.android.support:recyclerview-v7:25.3.1'
        compile "com.android.support:support-v4:25.3.1"
      compile "com.android.support:cardview-v7:25.3.1"
      compile "com.android.support:design:25.3.1"
      compile "com.android.support.constraint:constraint-layout:25.3.1"
    

    相关文章

      网友评论

          本文标题:Android 3rd party libs by functi

          本文链接:https://www.haomeiwen.com/subject/ihvecxtx.html