android studio Kotlin中使用常用的一些包,有了这些包则天下无敌

// Top-level build file where you can add configuration options common to all sub-projects/modules.

/*Make sure that you have the $anko_version settled in your gradle file at the project level:
  https://github.com/Kotlin/anko*/
def ankoVersion = '0.10.4'
//grpc version  1.14.0-SNAPSHOT https://github.com/grpc/grpc-java
def grpcVrsion='1.13.2'
//GsonVersions
def gosnVesion = '2.8.2'
//https://github.com/greenrobot/EventBus
def eventbusVesion='3.1.1'
//https://github.com/vinc3m1/RoundedImageView
def roundedimageview='2.3.0'
//加载动画https://jitpack.io/p/leogiroux/sweet-alert-dialog
def sweetalertVesion='1.5.2'
//google推出的防止包错乱
def multidexVesion='1.0.2'
//图片请求框架  https://blog.csdn.net/zhuhai__yizhi/article/details/77498729
def glideVesion='4.7.1'
//MessagePack框架https://blog.csdn.net/xundh/article/details/53979114  netty里的编码和解码包msgpack
//https://msgpack.org/
//netty打包 msgpackCoreVesion   https://blog.csdn.net/xundh/article/details/53979114
//def msgpackCoreVesion='0.8.16'
def msgpackVesion='1.0.0-beta'
def constraintLayoutVesion='1.1.2'
//https://github.com/bingoogolapple/BGAQRCode-Android  //二维码解码,使用zbar,因为使用的是c语言编写,解码速度快
def zbarVersion='1.2.5'
dependencies {
    //默认加载包
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    // Kotlin 针对 JDK 7 或 JDK 8
    //implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
    // implementation "org.jetbrains.kotlin:kotlin-stdlib-jre8:$kotlin_version"
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
    //implementation "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"
    // Android Support
    implementation "com.android.support:support-v4:$supportLibVersion"
    implementation "com.android.support:appcompat-v7:$supportLibVersion"
    implementation "com.android.support:design:$supportLibVersion"
    implementation "com.android.support:support-fragment:$supportLibVersion"
    implementation "com.android.support:support-annotations:$supportLibVersion"
    //implementation "com.android.support.constraint:constraint-layout:$constraintLayoutVesion"
    implementation "com.android.support:recyclerview-v7:$supportLibVersion"
    implementation "com.android.support:cardview-v7:$supportLibVersion"

    implementation "com.makeramen:roundedimageview:$roundedimageview"

    /* https://github.com/Kotlin/anko  学习文档https://juejin.im/entry/5a13ea795188252abc5dfcd8
      1.find()代替findViewById()
       2.longToast()代替原生Toast()
       3.startActivity(vararg params: Pair代替原生startActivity()
       4.Anko SQLite简化原生的SQLite的使用
       5.Dialogs的简化使用  */
    implementation "org.jetbrains.anko:anko:$ankoVersion"
    // You need to build grpc-java to obtain these libraries below. https://github.com/grpc/grpc-java
    implementation "io.grpc:grpc-okhttp:$grpcVrsion" // CURRENT_GRPC_VERSION
    implementation "io.grpc:grpc-protobuf-lite:$grpcVrsion" // CURRENT_GRPC_VERSION
    implementation "io.grpc:grpc-stub:$grpcVrsion" // CURRENT_GRPC_VERSION
    implementation 'javax.annotation:javax.annotation-api:1.2'

    //图片请求框架  https://blog.csdn.net/zhuhai__yizhi/article/details/77498729
    implementation "com.github.bumptech.glide:glide:$glideVesion"
    //使用gson解析数据和封装数据
   implementation "com.google.code.gson:gson:$gosnVesion"
    //MessagePack框架 https://blog.csdn.net/xundh/article/details/53979114  netty里的编码和解码包msgpack
    //MessagePack //https://msgpack.org/
    //netty打包 msgpackCoreVesion   https://blog.csdn.net/xundh/article/details/53979114
    //POJO的序列化/反序列化
    //implementation "com.daveanthonythomas.moshipack:moshipack:$msgpackVesion"
    //implementation "com.daveanthonythomas.moshipack:moshipack-retrofit:$msgpackVesion"
    /* EventBus是一款Android下的发布/订阅事件总线机制。
       可以代替Intent、Handler、Broadcast等在Fragment、Activity之间传递消息。
       优点:开销小,代码优雅。将发送者和接受者解耦。 */
    implementation "org.greenrobot:eventbus:$eventbusVesion"

    /*multidex 在android5.0----之前----,每一个android应用中只会含有一个dex文件,
     但是因为Android系统本身的BUG,使得这个dex的方法数量被限制在65535之内,这就是著名的"64K(641024)"*事件*/
    implementation "com.android.support:multidex:$multidexVesion"//防止包出现混乱 //google推出的防止包错乱
    //加载弹出框架https://jitpack.io/p/leogiroux/sweet-alert-dialog
   // implementation "com.github.f0ris.sweetalert:library:$sweetalertVesion"
    //添加 kapt 的依赖后即可与 Kotlin 代码交互:
    //  kapt "com.android.databinding:compiler:$gradle_version"

    //二维码解码,使用zbar,因为使用的是c语言编写,解码速度快
    implementation "cn.bingoogolapple:bga-qrcode-zbar:$zbarVersion"
    //录音时的动画
   // implementation 'com.carlos.voiceline:mylibrary:1.0.6' //https://github.com/ws123/VoiceLine

    //测试包
 //    testImplementation 'junit:junit:4.12'
//    androidTestImplementation 'com.android.support.test:runner:1.0.2'
//    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
//    testImplementation "org.mockito:mockito-core:2.13.0"
//    testImplementation "com.nhaarman.mockitokotlin2:mockito-kotlin:2.0.0-alpha03"
//    testImplementation "org.robolectric:robolectric:3.7"

}

详细配置地址 dependencies.gradle

你可能感兴趣的:(Kotlin)