Gradle笔记——Android开发常用的Gradle依赖
在日常的Android开发肯定少不了Android的build.gradle
文件配置,下面是我收集常用的依赖配置,每个月会更新一次。
开发环境
JDK环境:JDK1.8。
编译器:Android Studio3.0以上。
配置Java8依赖
大部分依赖都要支持Java8。
compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 }
AndroidX
现在Android开发项目,大部分创建都是默认支持AndroidX。
implementation 'androidx.appcompat:appcompat:1.1.0'
Constraintlayout(约束布局)
现在Android开发大部分都使用约束布局。
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
Retrofit网络请求
GitHub地址 https://github.com/square/retrofit
// Retrofit2.0所需依赖 implementation 'com.squareup.retrofit2:retrofit:2.5.0' // 接口返回Json数据转为实体类所需依赖 implementation 'com.squareup.retrofit2:converter-gson:2.5.0' // 结果转为基本类型所需依赖 implementation 'com.squareup.retrofit2:converter-scalars:2.4.0'
OkHttp网络请求
GitHub地址 https://github.com/square/okhttp
implementation 'com.squareup.okhttp3:okhttp:4.1.1'
implementation 'com.squareup.okio:okio:2.2.2'
OkGo网络请求
GitHub地址 https://github.com/jeasonlzy/okhttp-OkGo
//必须使用 implementation 'com.lzy.net:okgo:3.0.4' //以下三个选择添加,okrx和okrx2不能同时使用 implementation 'com.lzy.net:okrx:1.0.2' implementation 'com.lzy.net:okrx2:2.0.2' implementation 'com.lzy.net:okserver:2.0.5'
RxHttp网络请求
GitHub地址 https://github.com/liujingxing/RxHttp
// Rxhttp网络请求 implementation 'com.rxjava.rxhttp:rxhttp:1.1.6' // 注解处理器,生成RxHttp类 annotationProcessor 'com.rxjava.rxhttp:rxhttp-compiler:1.1.6' // 页面销毁,关闭请求,非必须 implementation 'com.rxjava.rxlife:rxlife:1.0.9'
RxJava
GitHub地址 https://github.com/ReactiveX/RxJava
// RxJava2 implementation 'io.reactivex.rxjava2:rxjava:2.2.12' // RxJava3 implementation "io.reactivex.rxjava3:rxjava:3.0.0-RC2"
RxAndroid
GitHub地址 https://github.com/ReactiveX/RxAndroid
implementation 'io.reactivex.rxjava2:rxandroid:2.1.1'
小刀注解(黄油刀)
GitHub地址 https://github.com/JakeWharton/butterknife
// 组件视图绑定依赖,黄油刀 implementation 'com.jakewharton:butterknife:10.1.0' annotationProcessor 'com.jakewharton:butterknife-compiler:10.1.0'
Design依赖,谷歌推荐的界面风格
implementation 'com.google.android.material:material:1.1.0-alpha10'
Litepal数据库
Github地址 https://github.com/LitePalFramework/LitePal
implementation 'org.litepal.android:java:3.0.0'
EventBus3.0
GitHub地址 https://github.com/greenrobot/EventBus
implementation 'org.greenrobot:eventbus:3.1.1'
今日头条屏幕适配方案
GitHub地址 https://github.com/JessYanCoding/AndroidAutoSize
implementation 'me.jessyan:autosize:1.1.2'
智能下拉刷新
GitHub地址 https://github.com/scwang90/SmartRefreshLayout
implementation 'com.scwang.smartrefresh:SmartRefreshLayout:1.1.0-alpha-22' implementation 'com.scwang.smartrefresh:SmartRefreshHeader:1.1.0-alpha-22' implementation 'androidx.legacy:legacy-support-v4:1.0.0'
FastJson
GitHub地址 https://github.com/alibaba/fastjson
implementation 'com.alibaba:fastjson:1.2.59'
Android代码发送邮件的库
一个同时支持Kotlin和Java的库,没有服务器的同学可以使用这个做用户反馈功能。Github地址 https://github.com/teprinciple/MailSender
implementation 'com.teprinciple:mailsender:1.1.0'
Android RecyclerView万能适配器
GitHub地址 https://github.com/CymChad/BaseRecyclerViewAdapterHelper
implementation 'com.github.CymChad:BaseRecyclerViewAdapterHelper:2.9.46'
Android仿iOS加载框
Github地址 https://github.com/saiwu-bigkoo/Android-SVProgressHUD
implementation 'com.bigkoo:svprogresshud:1.0.6'
Java-WebSocket
一个使用Java集成WebSocket开发Android IM客户端。GitHub地址https://github.com/TooTallNate/Java-WebSocket
implementation "org.java-websocket:Java-WebSocket:1.4.0"
Glide图片加载框架
GitHub地址 https://github.com/bumptech/glide
implementation 'com.github.bumptech.glide:glide:4.9.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.9.0'
阿里巴巴Android组件化路由
Github地址 https://github.com/alibaba/ARouter
implementation 'com.alibaba:arouter-api:1.4.1'
annotationProcessor 'com.alibaba:arouter-compiler:1.2.2'
希望我的这篇文章对Android开发的小伙伴们有帮助。推广一下我微信公众号,我会经常更新一下技术干货或者开发踩坑历程,欢迎大家关注我!
原文地址:https://www.cnblogs.com/yubo0522/p/11516735.html
- 开发者需要掌握的JS事件
- Java 集合系列03之 ArrayList详细介绍(源码解析)和使用示例
- Kosaraju算法、Tarjan算法分析及证明--强连通分量的线性算法
- 关于curl网站运维与开发的那些事
- 并查集Union-find及其在最小生成树中的应用
- go 语言的库文件放在哪里?如何通过nginx代理后还能正确获取远程地址
- 离线Tarjan算法-最近公共祖先问题
- Java文件上传下载实训
- 【网络编程系列】二:socket通信原理及实践
- textrank算法原理与提取关键词、自动提取摘要PYTHON
- 【网络编程系列】一:字节顺序的大端与小端表示法
- Linux下的make命令用法
- 增量数据丢失的原因分析(三)(r8笔记第91天)
- JS之浏览器对象BOM
- java教程
- Java快速入门
- Java 开发环境配置
- Java基本语法
- Java 对象和类
- Java 基本数据类型
- Java 变量类型
- Java 修饰符
- Java 运算符
- Java 循环结构
- Java 分支结构
- Java Number类
- Java Character类
- Java String类
- Java StringBuffer和StringBuilder类
- Java 数组
- Java 日期时间
- Java 正则表达式
- Java 方法
- Java 流(Stream)、文件(File)和IO
- Java 异常处理
- Java 继承
- Java 重写(Override)与重载(Overload)
- Java 多态
- Java 抽象类
- Java 封装
- Java 接口
- Java 包(package)
- Java 数据结构
- Java 集合框架
- Java 泛型
- Java 序列化
- Java 网络编程
- Java 发送邮件
- Java 多线程编程
- Java Applet基础
- Java 文档注释
- Redis系列(十二)scan Info Object等特殊命令集合
- 使用纯CSS给网站文章中的外链添加小图标
- iOS美团同款"ZSource"二进制调试实现
- 使用picocm来进行Linux下的串口调试
- vue-drawer-layout实现手势滑出菜单栏
- iOS面试之UI大全
- 基于Ant Design Vue封装一个表单控件
- Rust闭包的虫洞穿梭
- TS 设计模式08 - 发布订阅模式
- GrowingIO 数据采集 iOS SDK 测试实践
- Kubernetes 1.19.0——Pod(2)
- 极速40分钟写出SQLite数据展示与导出功能【技术创作101训练营】
- opencv cudacodec VideoReader 报错
- Flutter中富文件标签的解决方案
- JDK 15已发布,你所要知道的都在这里!