您的位置:首页 > 移动开发 > Android开发

一些比较好的Android 开源框架

2016-07-11 15:17 501 查看
P.S.某些大厂的开源库,是内部不知道测试了多少遍才抛出来的,所以很多可见bug除非没测到否则是不会推荐给你们用的,所以说感谢这些开源的项目和所有默默奉献的开发者。so,第一个建议就是多看看Google推出的开源库,当然也包括Facebook、Square。

1. 网络库:
GitHub - square/retrofit: Type-safe HTTP client for Android and Java by Square, Inc.

Retrofit 是 Square 公司出品的 HTTP 请求库, 同时是 Square 是最早开源项目之一, Retrofit 是目前 Android 最流行的 Http Client 库, 目前版本是 Retrofit 2.1.0。除了这个其他的网络库都歇着吧!

2.图片加载库:
GitHub - square/picasso: A powerful image downloading and caching library for Android

GitHub - bumptech/glide: An image loading and caching library for Android focused on smooth scrolling

GitHub - facebook/fresco: An Android library for managing images and the memory they use.

GitHub - nostra13/Android-Universal-Image-Loader: Powerful and flexible library for loading, caching and displaying images
on Android.

喜欢用square的全家桶,所以现在项目中使用的最多的是Picasso。Google推荐的图片加载库Glide,使用方式和Picasso很像。Fresco一款用于Android应用中展示图片的强大图片库,可以从网络、本地存储和本地资源中加载图片。Android-Universal-Image-Loader是最早的老牌图片加载库,现在的许多项目中还在用。

3.数据库:
GitHub - Raizlabs/DBFlow: A blazing fast, powerful, and very simple ORM android database library that writes database code for you.

尽管项目中没有使用开源的数据库,主要是程序中更换太麻烦所以还是用默认的;高票推荐的greenDAO性能很高。这里在推荐的是DBFlow,它自己的介绍是A robust, powerful, and very simple ORM android database library with annotation processing.一个屌爆的,强大的,和使用非常简单的通过注解处理的ORM Android数据库。

4.其他更屌的库:

RxJava
GitHub - ReactiveX/RxJava: RxJava

RxJava的操作符、Schedulers的线程间切换,避免了程序中那些迷之回调以及那些for循环if判断所带来的深度嵌套,配合Retrofit可以让战斗力成倍提升,让人感觉不像是在写的是Java。
像这样:

<img src="https://pic1.zhimg.com/ce0de3eb55ad532acdc5c32260c7fa60_b.png" data-rawwidth="1065" data-rawheight="1288" class="origin_image zh-lightbox-thumb" width="1065" data-original="https://pic1.zhimg.com/ce0de3eb55ad532acdc5c32260c7fa60_r.png">


Dagger
GitHub - square/dagger: A fast dependency injector for Android and Java.

Dagger框架为了简化你的代码,让你把你的注意力转移到真正需要关注的类上 ,比如:

我们常说要通过工厂类来创建出产品类对象。但是,往往我们更重视的是产品类,而并不是工厂类,更不是它的生产过程。

例如使用Retrofit加载网络数据,老子连单例都懒的写还会写这些!所以Dagger就是解放这些的。

<img src="https://pic4.zhimg.com/9990f1743ddc6093bbe42349418d59c7_b.png" data-rawwidth="791" data-rawheight="1252" class="origin_image zh-lightbox-thumb" width="791" data-original="https://pic4.zhimg.com/9990f1743ddc6093bbe42349418d59c7_r.png">


butterknife
https://github.com/JakeWharton/butterknife

好吧大家都说butterknife,也算一个吧,少写几句findViewById,onClick()还是很方便的!
教程:

<img src="https://pic2.zhimg.com/bd49c90f1c144446f5909ac8d2466a31_b.png" data-rawwidth="484" data-rawheight="349" class="origin_image zh-lightbox-thumb" width="484" data-original="https://pic2.zhimg.com/bd49c90f1c144446f5909ac8d2466a31_r.png">


<img src="https://pic4.zhimg.com/eed82bd3c2093754dd38a4ad64317d5f_b.png" data-rawwidth="631" data-rawheight="349" class="origin_image zh-lightbox-thumb" width="631" data-original="https://pic4.zhimg.com/eed82bd3c2093754dd38a4ad64317d5f_r.png">


上面的开源框架链接都已经给了,大家可以直接点击链接进入项目主页进行查看学习!

最后附上网易云音乐开发过程中使用的第三方开源类库、组件:

原文:网易云音乐Android版使用的开源组件

material-dialogs MD 对话框
fastjson JSON解析

fresco 图片加载

CircleProgress 圆形进度条

drag-sort-listview 拖拽重新排序

BottomSheet 底部菜单操作 bottom sheets
android-flowlayout 流式布局

Android-ObservableScrollView 滚动视图观测滚动事件

android-stackblur /

NativeStackBlur 高斯模糊使用

NativeBlurProcess
PagerSlidingTabStrip

ViewPager 滑动页面导航效果
HoloColorPicker 颜色选择器

ZoomableDraweeView-sample Fresco's ZoomableDraweeView

shimmer-android View闪光效果

SwipeBackLayout 滑动返回效果

android-FlipView 翻转动画效果

fab-transformation 浮动操作按钮切换

android-wheel Wheel Picker

pinyin4j 汉字转拼音

DanmakuFlameMaster 开源弹幕引擎

cybergarage-upnp DLNA

PhotoView 图片缩放


好吧,网上的框架、组件确实收集了一些:
GitHub - codedavid/android_library


如果有帮助star一下,谢谢!

ps:转自:码农大卫 
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  开源项目 Android