您的位置: 第一财商网 > 资讯 > 正文

72种Android开发开源工具库推荐(欢迎补充!)

2020-06-26 05:06:58来源:阅读:-

工具库

主要包括那些不错的开发库,包括依赖注入框架、图片缓存、网络相关、数据库ORM建模、Android公共库、Android 高版本向低版本兼容、多媒体相关及其他。

一、依赖注入DI

通过依赖注入减少View、服务、资源简化初始化,事件绑定等重复繁琐工作

1.AndroidAnnotations(Code Diet)

android快速开发框架

项目地址: https://github.com/excilys/androidannotations

文档介绍: https://github.com/excilys/androidannotations/wiki

官方网站: http://androidannotations.org/

特点:(1) 依赖注入:包括view,extras,系统服务,资源等等

(2) 简单的线程模型,通过annotation表示方法运行在ui线程还是后台线程

(3) 事件绑定:通过annotation表示view的响应事件,不用在写内部类

(4) REST客户端:定义客户端接口,自动生成REST请求的实现

(5) 没有你想象的复杂:AndroidAnnotations只是在在编译时生成相应子类

(6) 不影响应用性能:仅50kb,在编译时完成,不会对运行时有性能影响。

PS:与roboguice的比较:roboguice通过运行时读取annotations进行反射,所以可能影响应用性能,而AndroidAnnotations在编译时生成子类,所以对性能没有影响

2.roboguice

帮你处理了很多代码异常,利用annotation使得更少的代码完成项目

项目地址: https://github.com/roboguice/roboguice

文档介绍: https://github.com/roboguice/roboguice/wiki

3.butterknife

利用annotation帮你快速完成View的初始化,减少代码

项目地址: https://github.com/JakeWharton/butterknife

文档介绍: http://jakewharton.github.io/butterknife/

4.Dagger

依赖注入,适用于Android和Java

项目地址: https://github.com/square/dagger

文档介绍: http://square.github.io/dagger/

二、图片缓存

1.Android-Universal-Image-Loader

图片缓存,目前使用最广泛的图片缓存,支持主流图片缓存的绝大多数特性。

项目地址: https://github.com/nostra13/Android-Universal-Image-Loader

Demo地址: https://github.com/Trinea/TrineaDownload/blob/master/universal-imageloader-demo.apk?raw=true

文档介绍: http://www.intexsoft.com/blog/item/74-universal-image-loader-part-3.html

2.picasso

square开源的图片缓存

项目地址: https://github.com/square/picasso

文档介绍: http://square.github.io/picasso/

特点:(1)可以自动检测adapter的重用并取消之前的下载

(2)图片变换

(3)可以加载本地资源

(4)可以设置占位资源

(5)支持debug模式

3.ImageCache

图片缓存,包含内存和Sdcard缓存

项目地址: https://github.com/Trinea/AndroidCommon

Demo地址: https://play.google.com/store/apps/details?id=cn.trinea.android.demo

文档介绍: http://www.trinea.cn/android/android-imagecache/

特点:(1)支持预取新图片,支持等待队列

(2)包含二级缓存,可自定义文件名保存规则

(3)可选择多种缓存算法(FIFO、LIFO、LRU、MRU、LFU、MFU等13种)或自定义缓存算法

(4)可方便的保存及初始化恢复数据

(5)支持不同类型网络处理

(6)可根据系统配置初始化缓存等

4.Cube ImageLoader

阿里巴巴一淘使用的图片加载,综合了Android-Universal-Image-Loader 和 square 等组件优点,简单易用,良好的中文文档支持

项目地址: https://github.com/etao-open-source/cube-sdk

Demo地址: https://github.com/liaohuqiu/cube-sdk/raw/master/cube-sdk-sample.apk

文档介绍: http://cube-sdk.liaohuqiu.net/

效果图:

72种Android开发开源工具库推荐(欢迎补充!)

三、网络相关

1.Asynchronous Http Client for Android

Android异步Http请求

项目地址: https://github.com/loopj/android-async-http

文档介绍: http://loopj.com/android-async-http/

特点:(1) 在匿名回调中处理请求结果

(2) 在UI线程外进行http请求

(3) 文件断点上传

(4) 智能重试

(5) 默认gzip压缩

(6) 支持解析成Json格式

(7) 可将Cookies持久化到SharedPreferences

2.android-query

异步加载,更少代码完成Android加载

项目地址: https://github.com/androidquery/androidquery 或 https://code.google.com/p/android-query/

文档介绍: https://code.google.com/p/android-query/#Why_AQuery?

Demo地址: https://play.google.com/store/apps/details?id=com.androidquery

特点: https://code.google.com/p/android-query/#Why_AQuery?

3.Async Http Client

Java异步Http请求

项目地址: https://github.com/AsyncHttpClient/async-http-client

文档介绍: http://sonatype.github.io/async-http-client/

4.Ion

支持图片、json、http post等异步请求

项目地址: https://github.com/koush/ion

文档介绍: https://github.com/koush/ion#more-examples

5.HttpCache

Http缓存

项目地址: https://github.com/Trinea/AndroidCommon

Demo地址: https://play.google.com/store/apps/details?id=cn.trinea.android.demo

文档介绍: http://www.trinea.cn/android/android-http-cache

特点是:(1) 根据cache-control、expires缓存http请求

(2) 支持同步、异步Http请求

(3) 在匿名回调中处理请求结果

(4) 在UI线程外进行http请求

(5) 默认gzip压缩

6.Http Request

项目地址: https://github.com/kevinsawicki/http-request

文档介绍: https://github.com/kevinsawicki/http-request#examples

7.okhttp

square开源的http工具类

项目地址: https://github.com/square/okhttp

文档介绍: http://square.github.io/okhttp/

特点:(1) 支持SPDY( http://zh.wikipedia.org/wiki/SPDY )协议。SPDY协议是Google开发的基于传输控制协议的应用层协议,通过压缩,多路复用(一个TCP链接传送网页和图片等资源)和优先级来缩短加载时间。

(2) 如果SPDY不可用,利用连接池减少请求延迟

(3) Gzip压缩

(4) Response缓存减少不必要的请求

8.Retrofit

RESTFUL API设计

项目地址: https://github.com/square/retrofit

文档介绍: http://square.github.io/retrofit/

9.RoboSpice

Android异步网络请求工具,支持缓存、REST等等

项目地址: https://github.com/stephanenicolas/robospice

Demo地址: https://github.com/stephanenicolas/RoboDemo/downloads

四、数据库 orm工具包

orm的db工具类,简化建表、查询、更新、插入、事务、索引的操作

1.greenDAO

Android Sqlite orm的db工具类

项目地址: https://github.com/greenrobot/greenDAO

文档介绍: http://greendao-orm.com/documentation/

官方网站: http://greendao-orm.com/

特点:(1) 性能佳

(2) 简单易用的API

(3) 内存小好小

(4) 库大小小

2.ActiveAndroid

Android Sqlite orm的db工具类

项目地址: https://github.com/pardom/ActiveAndroid

文档介绍: https://github.com/pardom/ActiveAndroid/wiki/_pages

3.Sprinkles

Android Sqlite orm的db工具类

项目地址: https://github.com/emilsjolander/sprinkles

文档介绍: http://emilsjolander.github.io/blog/2013/12/18/android-with-sprinkles/

特点:比较显著的特点就是配合 https://github.com/square/retrofit 能保存从服务器获取的数据

4.Realm

移动端的数据库,适用于 Phone、Tablet、Wearable,支持 ORM,线程安全、支持连表及数据库加密,比 SQLite 性能更好

项目地址: https://github.com/realm/realm-java

文档介绍: http://realm.io/docs/java/0.72.0/

5.ormlite-android

项目地址: https://github.com/j256/ormlite-android

文档介绍: http://ormlite.com/sqlite_java_android_orm.shtml

6.Schematic

根据SQLite生成ContentProvider

项目地址: https://github.com/SimonVT/schematic

五、Android公共库

1.Guava

Google的基于java1.6的类库集合的扩展项目,包括collections, caching, primitives support, concurrency libraries, common annotations, string processing, I/O等等. 这些高质量的API可以使你的JAVa代码更加优雅,更加简洁

项目地址: https://code.google.com/p/guava-libraries/

文档介绍: https://code.google.com/p/guava-libraries/wiki/GuavaExplained

2.Volley

Google提供的网络通信库,使得网络请求更简单、更快速

项目地址: https://android.googlesource.com/platform/frameworks/volley

Github地址: https://github.com/mcxiaoke/android-volley

文档地址: http://commondatastorage.googleapis.com/io-2013/presentations/110%20-%20Volley-%20Easy,%20Fast%20Networking%20for%20Android.pdf

3.AndroidCommon

Android公共库

项目地址: https://github.com/Trinea/AndroidCommon

Demo地址: https://play.google.com/store/apps/details?id=cn.trinea.android.demo

文档介绍: http://www.trinea.cn/android/android-common-lib/

包括:(1)缓存(图片缓存、预取缓存、网络缓存)

(2) 公共View(下拉及底部加载更多ListView、底部加载更多ScrollView、滑动一页Gallery)

(3) Android常用工具类(网络、下载、Android资源操作、shell、文件、Json、随机数、Collection等等)

4.shipfaster

整合了Dagger Otto Retrofit Robolectric Picasso OkHttp,方便快速开发

项目地址: https://github.com/pyricau/shipfaster

CleanAndroidCode

整合了Dagger Otto AndroidAnnotations,方便快速开发

项目地址: https://github.com/pyricau/CleanAndroidCode

5.xUtils

基于Afinal,包含DbUtils、ViewUtils、HttpUtils、BitmapUtils四大模块,可用于快速开发

项目地址: https://github.com/wyouflf/xUtils

6.Afinal

Afinal是一个android的ioc,orm框架,内置了四大模块功能:FinalAcitivity,FinalBitmap,FinalDb,FinalHttp。通过finalActivity,我们可以通过注解的方式进行绑定ui和事件。通过finalBitmap,我们可以方便的加载bitmap图片,而无需考虑oom等问题。通过finalDB模块,我们一行代码就可以对android的sqlite数据库进行增删改查。通过FinalHttp模块,我们可以以ajax形式请求http数据

项目地址: https://github.com/yangfuhai/afinal

官方网站: http://www.afinal.org

7.UltimateAndroid

UltimateAndroid是一个快速开发Android应用的框架,框架目前主要包含的功能有View Injection,ORM,异步网络请求和图片加载,自动化脚本测试,磁盘LRU等功能.同时提供了类似于TripleDes、Webview快速设置、Md5处理、String处理,Https处理等常用工具类,还有超过100多种UI控件效果。

项目地址: https://github.com/cymcsg/UltimateAndroid

官方网站: http://blog.marshalchen.com/UltimateAndroid/

六、Android 高版本向低版本兼容

1.ActionBarSherlock

为Android所有版本提供统一的ActionBar,解决4.0以下ActionBar的适配问题

项目地址: https://github.com/JakeWharton/ActionBarSherlock

Demo地址: https://play.google.com/store/apps/details?id=com.actionbarsherlock.sample.demos

APP示例:太多了。。现在连google都在用

2.Nine Old Androids

将Android 3.0(Honeycomb)所有动画API(ObjectAnimator ValueAnimator等)兼容到Android1.0

项目地址: https://github.com/JakeWharton/NineOldAndroids

Demo地址: https://play.google.com/store/apps/details?id=com.jakewharton.nineoldandroids.sample

文档介绍: http://nineoldandroids.com/

3.HoloEverywhere

将Android 3.0的Holo主题兼容到Android2.1++

项目地址: https://github.com/Prototik/HoloEverywhere

Demo地址: https://raw.github.com/Prototik/HoloEverywhere/repo/org/holoeverywhere/demo/2.1.0/demo-2.1.0.apk

文档介绍: http://android-developers.blogspot.com/2012/01/holo-everywhere.html

4.SherlockNavigationDrawer

将Android NavigationDrawer和ActionbarSherlock结合,解决4.0以下NavigationDrawer的适配问题

项目地址: https://github.com/tobykurien/SherlockNavigationDrawer

文档地址: http://developer.android.com/training/implementing-navigation/nav-drawer.html

5.Notifications4EveryWhere

将Android 4.1的Notification兼容到Android2.2++

项目地址: https://github.com/youxiachai/Notifications4EveryWhere

6.Android Switch Widget Backport

将Android Switch和SwitchPreference的兼容到Android2.1++

项目地址: https://github.com/BoD/android-switch-backport

Demo地址: https://play.google.com/store/apps/details?id=org.jraf.android.backport.switchwidget.sample

文档介绍: https://github.com/BoD/android-switch-backport#using-the-switch

7.android-datepicker

将Android 4.0的datepicker兼容到Android2.2++

项目地址: https://github.com/SimonVT/android-datepicker

8.GlowPadBackport

Android 4.2的GlowPadView向后适配到API4以上

项目地址: https://github.com/frakbot/GlowPadBackport

9.Transitions Everywhere

Android 4.4 的 Transitions API 兼容到 Android 2.2 以上

项目地址: https://github.com/andkulikov/transitions-everywhere

七、多媒体相关

1.cocos2d-x

跨平台的2d游戏框架,支持Android、IOS、Linux、Windows等众多平台

项目地址: https://github.com/cocos2d/cocos2d-x

文档介绍: http://www.cocos2d-x.org/wiki

官方网站: http://www.cocos2d-x.org/

2.Vitamio

是一款Android与iOS平台上的全能多媒体开发框架

项目地址: https://github.com/yixia/VitamioBundle

网站介绍: http://www.vitamio.org/docs/

特点:(1) 全面支持硬件解码与GPU渲染

(2) 能够流畅播放720P甚至1080P高清MKV,FLV,MP4,MOV,TS,RMVB等常见格式的视频

(3) 在Android与iOS上跨平台支持 MMS, RTSP, RTMP, HLS(m3u8)等常见的多种视频流媒体协议,包括点播与直播。

3.PhotoProcessing

利用ndk处理图片库,支持Instafix、Ansel、Testino、XPro、Retro、BW、Sepia、Cyano、Georgia、Sahara、HDR、Rotate(旋转)、Flip(翻转)等各种特效

项目地址: https://github.com/lightbox/PhotoProcessing

Demo地址: https://github.com/Trinea/TrineaDownload/blob/master/photo-processing.apk?raw=true

4.Android StackBlur

图片模糊效果工具类

项目地址: https://github.com/kikoso/android-stackblur

Demo地址: https://github.com/kikoso/android-stackblur/blob/master/StackBlurDemo/bin/StackBlurDemo.apk?raw=true

文档介绍: https://github.com/kikoso/android-stackblur#usage

5.Bitmap Smart Clipping using OpenCV

图片智能裁剪保留重要部分显示

项目地址: https://github.com/beartung/tclip-android

利用淘宝的 http://code.taobao.org/p/tclip/ 库完成

一淘玩客正在使用的图片裁剪,自动识别图片中的重要区域,并且在图片裁剪时保留重要区域

特点:(1). 能进行人脸识别。图片中有人脸,将自动视为人脸区域为重要区域,将不会被裁剪掉

(2).自动其它重要区域。如果图片中未识别出人脸,则会根据特征分布计算出重区域

Cropper

图片局部剪切工具,可触摸控制选择区域或旋转

项目地址: https://github.com/edmodo/cropper

使用介绍: https://github.com/edmodo/cropper/wiki

效果图:

72种Android开发开源工具库推荐(欢迎补充!)

6.android-crop

图片裁剪Activity

项目地址: https://github.com/jdamcd/android-crop

效果图:

72种Android开发开源工具库推荐(欢迎补充!)

7.TileView

可分块显示大图,支持2D拖动、双击、双指放大、双指捏合

项目地址: https://github.com/moagrius/TileView

Demo地址: http://moagrius.github.io/TileView/TileViewDemo.apk

8.BlurEffectForAndroidDesign

图片模糊效果

项目地址: https://github.com/PomepuyN/BlurEffectForAndroidDesign

9.android-eye

PC端网页查看同一局域网内的手机摄像头内容,可以用来监控哦

项目地址: https://github.com/Teaonly/android-eye

Demo地址: https://play.google.com/store/apps/details?id=teaonly.droideye

10.libpng for Android

PNG图片的jni库,支持几乎png的所有特性

项目地址: https://github.com/julienr/libpng-android

文档地址: http://www.libpng.org/pub/png/libpng.html

11.android-gpuimage

基于GPU的图片滤镜

项目地址: https://github.com/CyberAgent/android-gpuimage

12.AndroidFaceCropper

图片脸部自动识别,将识别后的局部图片返回

项目地址: https://github.com/lafosca/AndroidFaceCropper

13.Android Video Crop

利用TextureView播放和剪切视频,类似ImageView.setScaleType

项目地址: https://github.com/dmytrodanylyk/android-video-crop

Demo地址: https://github.com/lafosca/AndroidFaceCropper/releases/download/1.0/FaceCropper-sample-debug-unaligned.apk

14.svg-android

Android Svg矢量图形支持

项目地址: https://github.com/japgolly/svg-android https://github.com/japgolly/svg-android

15.Android Visualizer

从Android MediaPlayer获得音频,然后像iTunes及WinAmp一样展示音轨

项目地址: https://github.com/felixpalmer/android-visualizer

16.ExoPlayer

包括仪表板和SmoothStreaming自适应回放,缓存持久化和自定义渲染器,方便自定义和扩展,并且可以通过应用商店更新

项目地址: https://github.com/google/ExoPlayer

17.DanmakuFlameMaster

android上开源弹幕解析绘制引擎项目

项目地址: https://github.com/ctiao/DanmakuFlameMaster

八、事件总线(订阅者模式)

通过发布/订阅事件解耦事件发送和接受,从而简化应用程序组件(Activities, Fragments及后台线程)之间的通信

1.EventBus

greenrobot的开源项目

项目地址: https://github.com/greenrobot/EventBus

文档介绍: https://github.com/greenrobot/EventBus#general-usage-and-api

特点:(1) 支持在不同类型的线程中处理订阅,包括发布所在线程,UI线程、单一后台线程、异步线程

(2) 支持事件优先级定义,支持优先级高的订阅者取消事件继续传递,支持粘性事件,是不是跟系统的有序广播、粘性广播很像啊

(3) 不是基于annotations

(4) 性能更优

(5) 体积小

(6) 支持单例创建或创建多个对象

(7) 支持根据事件类型订阅

2.Otto

Square的开源项目,基于Guava的Android优化

项目地址: https://github.com/square/otto

文档介绍: http://square.github.io/otto/

EventBus与Otto的功能及性能对比文档

EventBus与Otto性能对比Demo Apk

九、传感器

1.Great Android Sensing Toolkit

Android感应器工具包,包含示例及使用过程中可能需要的算法

项目地址: https://github.com/gast-lib/gast-lib

Demo地址: https://play.google.com/store/apps/details?id=root.gast.playground

文档介绍: https://github.com/gast-lib/gast-lib#documentation

2.SensorManager

Android传感器管理

项目地址: https://github.com/nlathia/SensorManager

文档介绍: https://docs.google.com/document/d/1TqThJULb-4e6TGb1gdkAaPCfyuXStjJpbnt7a0OZ9OE/edit

3.GPSLogger

记录GPS信息

项目地址: https://github.com/mendhak/gpslogger

Demo地址: https://play.google.com/store/apps/details?id=com.mendhak.gpslogger

文档介绍: http://code.mendhak.com/gpslogger/

4.Pedometer

计步器,使用硬件计步感应器

项目地址: https://github.com/j4velin/Pedometer

5.leapcast

ChromeCast模拟器的App

项目地址: https://github.com/dz0ny/leapcast

6.Arduino-Communicator

与Arduino通信的App

项目地址: https://github.com/jeppsson/Arduino-Communicator

7.android-pedometer

Android计步器

项目地址: https://github.com/bagilevi/android-pedometer

Demo地址: http://pedometer.googlecode.com/files/Pedometer-1.4.apk

8.OwnTracks for Android

自己的轨迹记录

项目地址: https://github.com/owntracks/android

9.Shake Detector library for Android

Android手机震动摇晃检测库,提供供UI线程调用的回调接口

项目地址: https://github.com/tbouron/ShakeDetector

Demo地址: https://play.google.com/store/apps/details?id=com.github.tbouron.shakedetector.example

10.Android heart rate monitor

Android心跳检测

项目地址: https://github.com/phishman3579/android-heart-rate-monitor

11.Bluetooth LE Library for Android

蓝牙源信息,包括宝库Mac、更新时间、RSSI、UUID、信号源距离、影响范围等信息

项目地址: https://github.com/alt236/Bluetooth-LE-Library---Android

Demo地址: https://play.google.com/store/apps/details?id=uk.co.alt236.btlescan

72.farebot

通过NFC 从公交卡中读取数据的一个应用

项目地址: https://github.com/codebutler/farebot

推荐阅读:2019笔记本电脑性价比排行榜

滚动推荐
06:5872种Android开发开源工具库
通过annotation表示方法运行在ui线程还是后台线程REST客户[详细]
01:16千元机没面子?盘点2019最值得入
随着手机市场的竞争的不断激烈,不少手机厂商把更多精力放在了高端市场与千[详细]
56:42Nokia 诺基亚 lumia 9
在smzdm潜水好长时间了,期间看大家一直买东西、晒东西。今天也晒一下[详细]
49:37适合女生用的四款高颜值千元机,配置
如果说男生更看好配置,那么女生对颜值要更为挑剔一些,即便当前的千元机,[详细]
46:49个人开发APP要多久?无需编程快速
“什么,这么几个简单的功能,都要这么长时间,等你们出来,黄花菜都凉了”[详细]
46:1611个非常实用的微信使用技巧大全
11个非常实用的微信使用技巧大全 看看你知道几个?建议收藏[详细]
32:56小米红米及MIUI手机开启系统自带
现在ROOT是手机的一大块事,可以说安卓手机无ROOT不安卓。在早前一[详细]