Android 开发非常有意义轮子 开发效率提升100% 强烈建议收藏

在 Android 开发的过程中,每个开发者或多或少的都使用过第三方开源库,使用第三方开源库可以大大减少开发者的精力和时间,从而更好的关注应用本身的业务逻辑。

网络相关

  • OkHttp

一个处理网络请求的开源项目,是安卓端最火热的网络框架

implementation("com.squareup.okhttp3:okhttp:4.10.0")

  • Retrofit

Retrofit 是一个适用于 Android 和 Java 的类型安全的 HTTP 客户端。值得注意的是:Retrofit 网络请求的本质工作是什么 OkHttp 完成的,而 Retrofit 只负责网络请求接口的封装。另外 Retrofit 运用了大量的设计模式(值得大家阅读源码学习),它们分别是:外观模式、构建者模式、工厂方法、策略模式、适配器模式、动态代理。

implementation 'com.squareup.retrofit2:retrofit:(insert latest version)'

图片相关

  • Glide

Glide是一个快速高效的Android图片加载库,注重于平滑的滚动。Glide提供了易用的API,高性能、可扩展的图片解码管道(decode pipeline),以及自动的资源池技术。值得注意的是:此库会根据 ImageView 的大小来动态改变下载的图片的尺寸大小,之后才会进行缓存,也就是说如果下载同一张图片,但设定了两个不一样大小的 ImageView ,那么 Glide 实际上会缓存两份的(这里的下载逻辑与下面的 Picasso 有所区别)。

  • Fresco

Fresco是非常强大的显示图像的开源库。

implementation 'com.facebook.fresco:fresco:2.6.0'

使用文档:
https://www.fresco-cn.org/

  • Picasso

一个强大的安卓图片下载和缓存库(两级缓存:内存、本地)。需要注意的是此库不支持 GIF 的支持。

implementation 'com.squareup.picasso:picasso:2.8'

数据库相关

  • greenDao

greenDAO 是一种用于 Android 的轻量级 ORM,可将对象映射到 SQLite 数据库。 greenDAO 针对 Android 进行了高度优化,提供出色的性能并消耗最少的内存。

implementation 'org.greenrobot:greendao:3.3.0' // add library

  • LitePal

LitePal是一款开源的Android数据库框架,它采用了对象关系映射(ORM)的模式,并将我们平时开发时最常用到的一些数据库功能进行了封装,使得不用编写一行SQL语句就可以完成各种建表、増删改查的操作。并且LitePal很“轻”,jar包只有100k不到,而且近乎零配置,这一点和Hibernate这类的框架有很大区别。

implementation 'org.litepal.guolindev:core:3.2.3'

  • Sugar ORM

Sugar ORM 的构建与其他 ORM 相比具有:

  1. 一个简单、简洁、干净的集成过程,配置最少。
  2. 通过反射自动命名表和列。
  3. 支持不同模式版本之间的迁移。

implementation 'com.github.satyan:sugar:1.5'

  • DBFlow

DBFlow 是基于 SQLite for Android 构建的快速、高效且功能丰富的 Kotlin 数据库库。 DBFlow 利用注解处理为您生成 SQLite 样板,并提供强大的 SQLite 查询语言,让使用 SQLite 成为一种乐趣。

kapt "com.github.agrosner.dbflow:processor:${dbflow_version}"

// Annotation Processor

// if only using Java, use this. If using Kotlin do NOT use this.

annotationProcessor "com.github.agrosner.dbflow:processor:${dbflow_version}"

// core set of libraries

implementation "com.github.agrosner.dbflow:core:${dbflow_version}"

implementation "com.github.agrosner.dbflow:lib:${dbflow_version}"

// sql-cipher database encryption (optional)

implementation "com.github.agrosner.dbflow:sqlcipher:${dbflow_version}"

implementation "net.zetetic:android-database-sqlcipher:${sqlcipher_version}@aar"

// RXJava 2 support

implementation "com.github.agrosner.dbflow:reactive-streams:${dbflow_version}"

// Kotlin Coroutines

implementation "com.github.agrosner.dbflow:coroutines:${dbflow_version}"

// Android Architecture Components Paging Library Support

implementation "com.github.agrosner.dbflow:paging:${dbflow_version}"

// Android Architecture Components LiveData Library Support

implementation "com.github.agrosner.dbflow:livedata:${dbflow_version}"

// adds generated content provider annotations + support.

implementation "com.github.agrosner.dbflow:contentprovider:${dbflow_version}"

事件分发相关

  • EventBus

EventBus 是适用于 Android 和 Java 发布/订阅事件总线。非常值得阅读源代码

implementation("org.greenrobot:eventbus:3.3.1")

异步相关

  • RxJava

一个使用可观察序列组成异步和基于事件的程序的库。

implementation 'io.reactivex.rxjava2:rxjava:2.0.5'

implementation 'io.reactivex.rxjava2:rxandroid:2.0.5'

性能相关

  • LeakCanary

LeakCanary是一个检测内存溢出的开源库

debugCompile 'com.squareup.leakcanary:leakcanary-android:1.5'

releaseCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.5'

testCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.5'

图表相关

  • MPAndroidChart

一个强大的制作图表的开源库,支持 线图、饼状图、雷达图、气泡图等

implementation 'com.github.PhilJay:MPAndroidChart:v3.0.1'

其他

ButterKnife

ButterKnife是一个视图的绑定工具,通过注释生成一些相应的代码,更简洁的代码

implementation 'com.jakewharton:butterknife:8.5.1'

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

Timber

Timber是一个开源的log框架

implementation 'com.jakewharton.timber:timber:5.0.1'

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

weijia3624

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值