0%

Great Open Source Frameworks of Android

原文出处:brave-sailor
Android中常用的优秀开源框架
15 个 Android 通用流行框架大全

Android开源框架库分类,挑选出最常用,最实用的开源项目,本篇主要介绍的是优秀开源框架库和项目,UI个性化控件会独立介绍。
UI个性化控件

Index

Dependency Injections
AndroidAnnotations
Butter Knife
Dagger
Networking
Android Lite Http
Asynchronous Http Client for Android
Async Http Client
HttpCache
Http Request
Ion
OkHttp
Retrofit
Volley
Volley OkHttp Android
Image Loader
Fresco
Cube SDK
Glide
ImageCache
Picasso
Universal Image Loader for Android
O/R Mapping
ActiveAndroid
GreenDAO
OrmLite-Android
Realm
Sugar ORM
Event Buses
EventBus
Otto
AndroidEventBus
JSON
fastjson
GSON
Jackson
Moshi
Background Processing
Bolts-Android
android-priority-jobqueue
Image Processing
android-gpuimage
ImageFilterForAndroid
Camera
cwac-camera
SquareCamera
CameraModule
OpenCamera
StickerCamera
Video
AndroidFFmpeg
Vitamio
Logging
Logger
DebugLog
hugo
Android Plugin
AndroidDynamicLoader
dynamic-load-apk
android-pluginmgr
Security
Conceal
SQLCipher
Showcases
PocketHub
iosched
Cheesesquare
muzei
u2020
Dependency Injections

AndroidAnnotations

Repository: https://github.com/excilys/androidannotations
Description: Android快速开发框架。
Features:

依赖注入:包括view,extras,系统服务,资源等等
简单的线程模型,通过annotation表示方法运行在ui线程还是后台线程
事件绑定:通过annotation表示view的响应事件,不用在写内部类
REST客户端:定义客户端接口,自动生成REST请求的实现
没有你想象的复杂:AndroidAnnotations只是在在编译时生成相应子类
不影响应用性能:仅50kb,在编译时完成,不会对运行时有性能影响。
PS:与roboguice的比较:roboguice通过运行时读取annotations进行反射,所以可能影响应用性能,而AndroidAnnotations在编译时生成子类,所以对性能没有影响。
Butter Knife

Repository: https://github.com/JakeWharton/butterknife
Description: JakeWharton的开源作品,利用annotation帮你快速完成View的初始化,减少代码。
Features:

支持 Activity 中的 View 注入
支持 View 中的 View 注入
支持 View 事件回调函数注入
Dagger

Repository: https://github.com/square/dagger
Description: sqaure开源的依赖注入框架,是Guice的一个子集,更轻量,更适合在Android平台使用。
Features:

使用 JSR-330标准注解进行构造器注入
使用@Provides注解创建对象
针对依赖树的中心上下文
昂贵资源延迟注入
同一接口的多种实现
静态注入 (针对遗留环境)
绑定的编译时验证
依赖注入框架的对比:dagger-and-butter-knife-vs-android-annotations,依赖注入浅析

Networking

Android Lite Http

Repository: https://github.com/litesuits/android-lite-http
Description: 一款‘智能’的HTTP框架类库。国人开发的一套框架。
Features:

单线程,所有方法都基于一个线程,绝不会跨线程,多线程的事情交给它自带的AsyncExecutor 或者更专业的框架库来解决。
灵活的架构,你可以轻松的替换Json自动化库、参数构建方式甚至默认的apache http client连接方式。
轻量级,微小的的开销,core jar包仅约86kb。
多种请求类型全面支持:get, post, head, put, delete, trace, options, patch.
多文件上传,不需要额外的类库支持。
内置的Dataparser支持文件和位图下载,你也可以自由的扩展DataParser来把原始的http inputstream转化为你想要的东西。
基于json的全自动对象转化: 框架帮你完成Java Object Model 和 Http Parameter之间的转化,完成Http Response与Java Object Model的转化。
自动重定向,基于一定的次数,不会造成死循环。
自动gizp压缩,帮你完成request编码和response解码以使http连接更加快速.
通过网络探测完成智能重试 ,对复杂的、信号不良的的移动网络做特殊的优化。
禁用一种或多种网络, 比如2G,3G。
简明且统一的异常处理体系:清晰、准确的抛出客户端、网络、服务器三种异常。
内置的AsyncExecutor可以让你轻松实现异步和并发的http请求,如果你喜欢,随意使用你自己的AsyncTask或Thread来完成异步,推荐使用更强大、高效的专业并发库。
Asynchronous Http Client for Android

Repository: https://github.com/loopj/android-async-http
Description: Android异步Http请求
Used By:

Instagram
Pinterest
Frontline Commando
Thousands more apps…
Features:

在匿名回调中处理请求结果
在UI线程外进行http请求
请求使用ThreadPool来处理并非资源的使用
文件断点上传
智能重试
默认gzip压缩
内置Json解析
可将Cookies持久化到SharedPreferences
More
Async Http Client

Repository: https://github.com/AsyncHttpClient/async-http-client
Description: Java异步Http和WebSocket请求。使用NIO实现异步操作,默认的异步实现是基于Netty之上。

HttpCache

Repository: https://github.com/Trinea/AndroidCommon
Description: Trinea大神写的Http缓存工具。
Features:

根据cache-control、expires缓存http请求
支持同步、异步Http请求
在匿名回调中处理请求结果
在UI线程外进行http请求
默认gzip压缩
Http Request

Repository: https://github.com/kevinsawicki/http-request
Description: Java HTTP请求库。

Ion

Repository: https://github.com/koush/ion
Description: Android异步网络和图片加载. Used By: https://github.com/koush/ion#projects-using-ion
Features: https://github.com/koush/ion#features

OkHttp

Repository: https://github.com/square/okhttp
Description: Square开源的http库,支持http和spdy协议.
Features:

支持HTTP2和SPDY
如果SPDY不可用,利用连接池减少请求延迟
使用GZIP压缩
Response缓存减少不必要的请求
Retrofit

Repository: https://github.com/square/retrofit
Description: Square开源的Android和Java的REST风格请求库.

Volley

Repository: google volley | https://github.com/mcxiaoke/android-volley
Description: Google提供的网络通信库,使得网络请求更简单、更快速
Features:

JSON,图像等的异步下载
网络请求的排序
网络请求的优先级处理
缓存
多级别取消请求
和Activity和生命周期的联动(Activity结束时同时取消所有网络请求)
More
Volley OkHttp Android

Repository: https://github.com/lxdvs/Volley-OkHttp-Android
Description: 整合OkHttp和Volley。

Image Loader

Fresco

Repository:

https://github.com/facebook/fresco
http://fresco-cn.org/
Description: Facebook 开源的一个强大的图片加载组件。
Features:

内存管理,两个内存缓存加上磁盘缓存构成了三级缓存
支持流式,图片的渐进式呈现
支持Gif图和WebP格式
更多样的显示,如圆角、进度条、点击重试、自定义对焦点
支持Android2.3+
Cube SDK

Repository: https://github.com/etao-open-source/cube-sdk
Description: 一淘开源的一款Android开发包,包括图片加载和网络请求服务,综合了Android-Universal-Image-Loader和square等组件优点。
Features:

使用简单
加载速度快,节省资源
方便定制和改造
图片复用
只关注请求结果,专注于业务
请求缓存 / 本地预设请求数据
简单的JsonData,轻松访问接口数据
基于Fragment的UI框架
屏幕尺寸信息
网络状态信息
Glide

Repository: https://github.com/bumptech/glide
Description: 一个高效、开源、 Android设备上的媒体管理框架。灵活的API,可以和很多网络框架进行整合。
Features:

GIF动画的解码
本地视频剧照的解码
Activity生命周期的集成
转码的支持
动画的支持
OkHttp和Volley的支持
其他功能:图片加载过程中占位符等
ImageCache

Repository: https://github.com/Trinea/AndroidCommon
Description: Trinea开源的图片缓存,包含内存和Sdcard缓存。 Features:

支持预取新图片,支持等待队列
包含二级缓存,可自定义文件名保存规则
可选择多种缓存算法(FIFO、LIFO、LRU、MRU、LFU、MFU等13种)或自定义缓存算法
可方便的保存及初始化恢复数据
支持不同类型网络处理
可根据系统配置初始化缓存等
Picasso

Repository: https://github.com/square/picasso
Description: square开源的图片缓存。
Features:

可以自动检测adapter的重用并取消之前的下载
图片变换
可以加载本地资源
可以设置占位资源
支持debug模式
Universal Image Loader for Android

Repository: https://github.com/nostra13/Android-Universal-Image-Loader
Description: 应该是使用最多的图片缓存,支持主流图片缓存的绝大多数特性。
Features:

多线程图片加载(同步或者异步)
尽可能多的配置选项(线程池,加载器,解析器,内存/磁盘缓存,显示参数等等)
图片可以缓存在内存中,或者设备文件目录下,或者SD卡中
可以监听加载进度
可以自定义显示每一张图片时都带不同参数
支持Widget
Used By:
Applications using

O/R Mapping

5个推荐的orm框架

ActiveAndroid

Repository: https://github.com/pardom/ActiveAndroid
Description: ActiveAndroid是一个轻量级的orm框架,名称命令方式类似于Yii、Rails等使用的orm框架ActiveRecord。

GreenDAO

Repository: https://github.com/greenrobot/greenDAO
Description: GreenDAO是一个轻量级,快速的orm框架。简化建表、查询、更新、插入、事务、索引的操作。
Features:

性能突出(比ormlite快4-5倍), performance
库小,核心包小于100k
简单易用的API
支持protobuf
自动生成数据库访问代码
OrmLite-Android

Repository: https://github.com/j256/ormlite-android
Description: OrmLite不是Android平台专用的orm框架,它是一个Java orm,OrmLite For Android增加了对Android平台的支持。

Realm

Repository: https://github.com/realm/realm-java
Description: 移动端的数据库,适用于 Phone、Tablet、Wearable,支持 ORM,线程安全、支持连表及数据库加密,比 SQLite 性能更好。
Features:

着重移动端
简单易用的API
支持线程安全,关系数据库和加密
访问快速
跨平台
Sugar ORM

Repository: https://github.com/satyan/sugar
Description: Android平台专用orm框架。
Features:

配置少
自动生成表结构
支持在不同模式版本直接切换

Event Buses

EventBus

Repository: https://github.com/greenrobot/EventBus Description: 事件总线框架,非注解,效率非常高,这里是和square的otto的对比。
Features:

非注解
便利,以onEvent方法来接收
性能优化,是android上最快的事件总线框架
单例
事件继承
Otto

Repository: https://github.com/square/otto
Description: Square开源的事件总线框架,在Guava基础上加强,基于注解形式。

AndroidEventBus

Repository: https://github.com/bboyfeiyu/AndroidEventBus
Description: bboyfeiyu开源的事件总线框架,吸收了greenrobot的EventBus以及square的otto的优点,并在此基础上做出了相应的改进,使得事件总线框架更适合用户的使用习惯,也使得事件的投递更加的精准、灵活。

JSON

fastjson

Repository: https://github.com/alibaba/fastjson
Description: 阿里巴巴开源JSON解析库,是一个Java语言编写的高性能功能完善的JSON库。它采用一种“假定有序快速匹配”的算法,把JSON Parse的性能提升到极致,是目前Java语言中最快的JSON库。各种JSON库的比较
Features:

速度最快,测试表明,fastjson具有极快的性能,超越任其他的java json parser。包括自称最快的jackson
功能强大,完全支持java bean、集合、Map、日期、Enum,支持范型,支持自省
无依赖,能够直接运行在Java SE 5.0以上版本
支持Android
GSON

Repository: https://github.com/google/gson
Description: google开源的JSON解析库

Jackson

Repository: https://github.com/FasterXML/jackson-core
Description: Jackson可以轻松的将Java对象转换成json对象和xml文档,同样也可以将json、xml转换成Java对象

Moshi

Repository: https://github.com/square/moshi
Description: square开源的JSON库,与GSON相比,更少的内建类型,更少的配置,安全的html转义等。

Background Processing

Bolts-Android

Repository: https://github.com/BoltsFramework/Bolts-Android
Description: Parse发布的面向Android的底层库集合,参见parse-announces-bolts

android-priority-jobqueue

Repository: https://github.com/path/android-priority-jobqueue
Description: Path开源的android优先级任务队列框架。

Image Processing

android-gpuimage

Repository: https://github.com/path/android-priority-jobqueue
Description: GPUImage是个功能十分强大、又十分易用的图像处理库。提供各种各样的图像处理滤镜,并且支持照相机和摄像机的实时滤镜。

ImageFilterForAndroid

Repository: https://github.com/daizhenjun/ImageFilterForAndroid
Description: 国内的代震军开源的滤镜效果框架。

Camera

cwac-camera

Repository: https://github.com/commonsguy/cwac-camera
Description: commonsguy开源的camera操作封装。

SquareCamera

Repository: https://github.com/boxme/SquareCamera
Description: 正方的摄像机,有前后摄像头等操作。

CameraModule

Repository: https://github.com/Yalantis/CameraModule
Description: Yalantis开源的摄像机,有自动聚焦功能等。

OpenCamera

Repository: https://github.com/almalence/OpenCamera
Description: 完整的摄像机,功能很全,不过代码有点乱。

StickerCamera

Repository: https://github.com/Skykai521/StickerCamera
Description: 这是一款集成了相机,图片裁剪,给图片贴贴图打标签的相机应用。

Video

AndroidFFmpeg

Repository: https://github.com/appunite/AndroidFFmpeg
Description: FFmpeg视频解析的例子。

Vitamio

Repository: https://github.com/yixia/VitamioBundle
Description: Vitamio是一款Android 与iOS 平台上的全能多媒体开发框架。
Features:

全面支持硬件解码与 GPU 渲染
能够流畅播放 720P 甚至 1080P 高清 MKV,FLV,MP4,MOV,TS,RMVB 等常见格式的视频
在 Android 与 iOS 上跨平台支持 MMS, RTSP, RTMP, HLS(m3u8)等常见的多种视频流媒体协议,包括点播与直播
Logging

Logger

Repository: https://github.com/orhanobut/logger
Description: 简单、美观而且十分强大的 Android 日志工具。

DebugLog

Repository: https://github.com/MustafaFerhan/DebugLog
Description: 可以帮你创建更简单和更容易理解的调试日志,能够友好的显示调试信息所在类和函数。

hugo

Repository: https://github.com/JakeWharton/hugo
Description: 用于打印函数信息及执行时间的工具,仅在 debug 模式生效。

Android Plugin

AndroidDynamicLoader

Repository: https://github.com/mmin18/AndroidDynamicLoader
Description: 点评的插件化实现方式,是用 Fragment 以及 Schema 的方式实现。

dynamic-load-apk

Repository: https://github.com/singwhatiwanna/dynamic-load-apk
Description: Apk动态加载框架,热部署,利用 ClassLoader 以及 Activity 代理的方式解决。

android-pluginmgr

Repository: https://github.com/houkx/android-pluginmgr
Description: 一种无须规范限制的动态加载解决方案,插件不需要依赖任何API
Features:

插件为普通apk,无须依赖任何jar
Activity生命周期由系统自己管理
使用简单,只需要了解一个类PluginManager的两个方法
启动Activity的效率高
不修改插件,被加载的插件仍然可以独立安装。
Security

Conceal

Repository: https://github.com/facebook/conceal
Description: Conceal是一套用于Android上的文件加密和鉴权的Java API

SQLCipher

Repository: https://github.com/sqlcipher/android-database-sqlcipher
Description: Sqlite 加密工具

Showcases

PocketHub

Repository: https://github.com/pockethub/PocketHub
Description: Github 的 Android 客户端项目

iosched

Repository: https://github.com/google/iosched
Description: The Google I/O 2014 Android App

Cheesesquare

Repository: https://github.com/chrisbanes/cheesesquare
Description: Demos the new Android Design library

muzei

Repository: https://github.com/romannurik/muzei
Description: 定时更换桌面精美壁纸

u2020

Repository: https://github.com/JakeWharton/u2020
Description: 开源框架集成的demo

欢迎关注我的其它发布渠道