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

Android干货框架集锦,搭建项目必不可少

2016-12-30 14:49 489 查看
http://mp.weixin.qq.com/s/sTLxfBq6ACcWPBf-_J8m_Q

2016-12-28 APP架构师



在开发过程中我们使用过很多优秀框架,比如网络的okhttp,图片的Fresco,注入的Gagger2等,都是非常优秀的框架。

所以今天在此介绍下至今本人知道的一些比较流行主流且很优秀的框架。



图片来自网络,如有侵权,请联系我删除,谢谢。

根据上图我们依次说明:


DiskLruCache

硬盘缓存最佳方案(Google提供的一套硬盘缓存的解决方案:DiskLruCache(非Google官方编写,但获得官方认证))


DiskLruCache:http://jakewharton.github.io/DiskLruCache/

最佳解析 :http://blog.csdn.net/guolin_blog/article/details/28863651?utm_source=tuicool&utm_medium=referral


Universal Image Loader

UIL aims to pr
ovide a p
owerful, flexible and highly customizable instrument forimage loading, caching and displaying.
It provides a lot of configuration options and good control over the image loading and caching process.


Universal Image Loader:https://github.com/nostra13/Android-Universal-Image-Loader

最佳解析:http://blog.csdn.net/xiaanming/article/details/26810303


Picasso

A powerful image downloading and caching library forAndroid


Picasso:https://github.com/square/picasso

最佳解析:http://www.jcodecraeer.com/a/anzhuokaifa/androidkaifa/2014/0731/1639.html


Facebook Fresco

Fresco 是一个强大的图片加载组件。
Fresco 中设计有一个叫做 image pipeline的模块。它负责从网络,从本地文件系统,本地资源加载图片。为了最大限度节省空间和CPU时间,它含有3级缓存设计(2级内存,1级文件)。
Fresco中设计有一个
叫做 Drawees 模块,方便地显示loading图,当图片不再显示在屏幕上时,及时地释放内
存和空间占用。Fresco 支持Android2.3(API level 9) 及其以上系统。


Facebook Fresco:https://github.com/facebook/fresco

最佳解析:http://www.fresco-cn.org/


Glide

在泰国举行的谷歌开发者论坛上,谷歌为我们介绍了一个名叫 Glide 的图片加载库,作者是bumptech。 这个库被广泛的运用在google的开源项目中,包括2014年google I/O大会上发布的官方app。


Glide:https://github.com/bumptech/glide

最佳解析:http://jcodecraeer.com/a/anzhuokaifa/androidkaifa/2015/0327/2650.html


Asynchronous Http Client forAndroid

An asynchronous, callback-based Http client
for
Android built on top
of Apache's HttpClient libraries.


Asynchronous Http Client forAndroid :https://github.com/loopj/android-async-http

最佳解析:http://www.cnblogs.com/angeldevil/p/3729808.html


AndroidAsync

AndroidAsync is a low level network protocol library.
If you are looking foran easy to use, higher level, Android aware, http request library, check out Ion (it is built on top of AndroidAsync).
The typical Android app developer would probably be more interested in Ion.


AndroidAsync:https://github.com/koush/AndroidAsync

最佳解析:http://hao.jobbole.com/androidasync/


OkHttp3

OkHttp是一个高效的Http客户端,有如下的特点:
支持HTTP2/SPDY黑科技  socket自动选择最好路线,并支持自动重连。
拥有自动维护的socket连接池,减少握手次数。
拥有队列线程池,轻松写并发。
拥有Interceptors轻松处理请求与响应(比如透明GZIP压缩,LOGGING)。
基于Headers的缓存策略。


OkHttp3:http://square.github.io/okhttp/

最佳解析:http://www.jianshu.com/p/aad5aacd79bf


Retrofit

A type-safe REST client
forAndroid and Java


Retrofit :http://square.github.io/retrofit/

最佳解析 :http://www.jcodecraeer.com/a/anzhuokaifa/androidkaifa/2015/0915/3460.html


Volley

Android Volley是Google开发的一个网络lib,可以让你更加简单并且快速的访问网络数据。Volley库的网络请求都是异步的,你不必担心异步处理问题。
Volley的优点:
请求队列和请求优先级
请求Cache和内存管理
扩展性性强
可以取消请求


Volley : https://developer.android.com/training/volley/index.html
最佳解析: http://bxbxbai.github.io/2014/09/14/android-working-with-volley/


google-gson

Gson is a Java library that can be used to convert Java Objects into their JSON representation.
It can also be used to convert a JSON string to an equivalent Java object.
Gson can work with arbitrary Java objects including pre-existing objects that you do not have source-code of.


Gson :https://github.com/google/gson

最佳解析 :http://www.jianshu.com/p/e740196225a4


Jackson

Thisis the home page of the Jackson Project, formerly known as the standard JSON library forJava (or JVM platform in general), or, as the "best JSON parser forJava." Or simply as "JSON forJava." More than that, Jackson is a suite of data-processing tools forJava (and the JVM platform), including the flagship streaming JSON parser / generator library, matching data-binding library (POJOs to and from JSON) and additional data format modules to process data encoded in Avro, BSON, CBOR, CSV, Smile, Protobuf, XML or YAML;
and even the large set of data format modules to support data types of widely used data types such as Joda, Guava and many, many more.
While the actual core components live under their own projects -- including the three core packages (streaming, databind, annotations;
data format libraries; data type libraries; JAX-RS provider;
and a miscellaneous set of other extension modules -- this project act as the central hub forlinking all the pieces together.


Jackson :https://github.com/FasterXML/jackson/

最佳解析:http://www.cnblogs.com/hoojo/archive/2011/04/22/2024628.html


fastjson

Fastjson是一个Java语言编写
的JSON处理
器,由阿里巴巴公司开发。
1、遵循http://json.org标准,为其官方网站收录的参考实现之一。
2、功能qiang打,支持JDK的各种类型,包括基本的JavaBean、Collection、Map、Date、Enum、泛型。  
3、无依赖,不需要例外额外的jar,能够直接跑在JDK上。  
4、开源,使用Apache License 2.0协议开源。http://code.alibabatech.com/wiki/display/FastJSON/Home
5、具有超高的性能,java世界里没有其他的json库能够和fastjson可相比了。


fastjson :https://github.com/alibaba/fastjson

最佳解析:http://blog.csdn.net/glarystar/article/details/6654494


HTML Parser

HTML Parser 
is
a Java library used to parse HTML in either a linear or nested fashion. Primarily used fortransformation or extraction, it features filters, visitors, custom tags and easy to use JavaBeans. It is a fast, robust and well tested package.


HTML Parser:http://htmlparser.sourceforge.net/


jsoup

jsoup
是一款Java 的HTML解析器,可直接解析某个URL地址、HTML文本内容。
它提供了一套非常省力的API,可通过DOM,CSS以及类似于jQuery的操作方法来取出和操作数据。


jsoup:http://www.open-open.com/jsoup/


ORMLite

暂缺,欢迎补充


ORMLite:http://www.ormlite.com/

最佳解析:http://blog.csdn.net/lmj623565791/article/details/39121377


Sugar

Insanely easy way to work with Android Databases.


Sugar:https://github.com/satyan/sugar

最佳解析:http://www.open-open.com/lib/view/open1423060633592.html


greenDAO

greenDAO
is a light & fast ORM forAndroid that maps objects to SQLite Being highly optimized forAndroid, greenDAOoffers great and consumes minimal memory.


greenDAO :https://github.com/greenrobot/greenDAO

最佳解析:http://www.open-open.com/lib/view/open1438065400878.html


ActiveAndroid

ActiveAndroid
is an active record style ORM (object relational mapper).
What does that mean exactly?
Well, ActiveAndroidallows you to save and retrieve SQLite database records without ever writing a single SQL statement.
Each database record is wrapped neatly into a class with methods like save() and delete().


ActiveAndroid :https://github.com/pardom/ActiveAndroid

最佳解析:http://www.jcodecraeer.com/a/anzhuokaifa/androidkaifa/2015/0104/2255.html


SQLBrite

A lightweight wrapper around
SQLiteOpenHelper and ContentResolver which introduces reactive stream semantics to queries.


SQLBrite :https://github.com/square/sqlbrite

最佳解析:http://www.jcodecraeer.com/a/anzhuokaifa/androidkaifa/2015/0306/2552.html


Realm

Realm
是一个跨平台的移动数据库引擎,
于 2014 年 7 月发布,准确来说,它是专门为移动应用所设计的数据持久化解决方案之一。


Realm:https://realm.io/

最佳解析:http://www.jcodecraeer.com/a/anzhuokaifa/androidkaifa/2015/1226/3807.html?utm_source=tuicool&utm_medium=referral


Butter Knife

Field
and method binding forAndroid views which uses annotation processing to generate boilerplate code foryou.


Butter Knife :http://jakewharton.github.io/butterknife/

最佳解析 :http://stormzhang.com/openandroid/android/2014/01/12/android-butterknife/

最佳解析(8.+):http://www.jianshu.com/p/0392199a682b


Dagger2

Dagger2
是一个Android依赖注入框架,由谷歌开发,最早的版本Dagger1由Square公司开发。
依赖注入框架主要用于模块间解耦,提高代码的健壮性和可维护性。
Dagger这个库的取名不仅仅来自它的本意“匕首”,同时也暗示了它的原理。
Jake Wharton 在对 Dagger 的介绍中指出,Dagger 即DAG-er,这里的 DAG 即数据结构中的 DAG——有向无环图(Directed Acyclic Graph)。
也就是说,Dagger是一个基于有向无环图结构的依赖注入库,因此Dagger的使用过程中不能出现循环依赖。


Dagger2 :http://google.github.io/dagger/

最佳解析:http://www.jcodecraeer.com/a/anzhuokaifa/androidkaifa/2015/0519/2892.html


AndroidAnnotations

AndroidAnnotations
is an Open Source framework that speeds up Android1,It takes care of the plumbing, and lets you concentrate  
2,what's really important. By simplifying your code, it facilitatesits maintenance.


AndroidAnnotations :http://androidannotations.org/

Wiki:https://github.com/excilys/androidannotations/wiki


RoboGuice 3

RoboGuice 3 smoothes out some of the wrinkles in your Android development experience and makes things simple and fun.
Do you always forget to check fornull when you getIntent().getExtras()? RoboGuice 3 will help you.     
Think casting findViewById() to a TextView shouldn’t be necessary? RoboGuice 3 is on it.


RoboGuice3 :https://github.com/roboguice/roboguice

最佳解析:http://www.cnblogs.com/avenwu/archive/2013/05/30/3109455.html


WilliamChart

WilliamChart is an Android Library to help the implementation of charts in android applications.
For the ones that would like to contribute, my idea is not only to implement the conventional chart features but instead something that could be pleasant and intuitive while representing and visualizing data.
I would prefer to keep charts simple and clean rather than overfeatured.


WilliamChart:https://github.com/diogobernardino/WilliamChart

最佳解析:http://www.jcodecraeer.com/a/anzhuokaifa/androidkaifa/2014/1011/1739.html


HelloCharts forAndroid

Charting library
forAndroid compatible with API 8+(Android 2.2). Works best when hardware acceleration is available, so API 14+(Android4.0) is recommended. Apache License 2.0.


HelloCharts forAndroid:https://github.com/lecho/hellocharts-android

最佳解析:http://www.jcodecraeer.com/a/anzhuokaifa/androidkaifa/2014/1107/1930.html


MPAndroidChart

MPAndroidChart是一款基于Android的开源图表库,MPAndroidChart不仅可以在 Android设备上绘制各种统计图表,而且可以对图表进行拖动和缩放操作,应用起来非常灵活。
MPAndroidChart同样拥有常用的图表类型:线 型图、饼图、柱状图和散点图。


MPAndroidChart :https://github.com/PhilJay/MPAndroidChart

最佳解析:http://www.jcodecraeer.com/a/anzhuokaifa/androidkaifa/2014/0506/1614.html


Tape

Tape是速度非快,事务性,基于文件的FIFO。用于Android和Java平台。


Tape:http://square.github.io/tape/


Android Priority Job Queue

Android
Priority Job Queue是一款专门为Android平台编写,实现了Job Queue的后台任务队列类库,能够轻松的在后台执行定时任务,提高用户体验和应用的稳定性。


Android Priority Job Queue:https://github.com/yigit/android-priority-jobqueue


EventBus

EventBus是一个Android端优化的publish/subscribe消 息总线,简化了应用程序内各组件间、组件与后台线程间的通信。
比如请求网络,等网络返回时通过Handler或Broadcast通知UI,两个 Fragment之间需要通过Listener通信,这些需求都可以通过EventBus实现。


EventBus :https://github.com/greenrobot/EventBus

最佳解析:http://www.cnblogs.com/angeldevil/p/3715934.html


Otto

An enhanced Guava-based
event bus with emphasis on Android support.
Otto is an event bus designed to decouple different parts of your application while still allowing them to communicate efficiently.
Forked from Guava, Otto adds unique functionality to an already refined event bus as well as specializing it to the Android platform.


Otto :https://github.com/square/otto

最佳解析:http://blog.csdn.net/zhangweiwtmdbf/article/details/49096615


RxAndroid: Reactive Extensions forAndroid

Android specific bindings
forRxJava.
Thismodule adds the minimum classes to RxJava that make writing reactive components in Android applications easy and hassle-free. More
specifically, it provides a Scheduler that schedules on the main thread or any given Looper.


RxAndroid :https://github.com/ReactiveX/RxAndroid

最佳解析:http://gank.io/post/560e15be2dca930e00da1083


RxBinding

RxJava binding APIs forAndroid UI widgets from the platform and support libraries.


RxBinding :https://github.com/JakeWharton/RxBinding

最佳解析:http://www.jianshu.com/p/c2c7c46e6b97/comments/1338430


Agera

Agera is a set of classes and interfaces to help write functional, asynchronous, and reactive applications forAndroid.


Agera :https://github.com/google/agera

最佳解析:http://www.open-open.com/lib/view/open1461748167891.html


Logger

Simple, pretty
and powerful logger forandroid
Logger provides :
Thread information
Class information
Method information
Pretty-print forjson content
Pretty-print fornew line "\n"Clean output
Jump to source


Logger:https://github.com/orhanobut/logger


Hugo

Annotation-triggered method call logging foryour debug builds.


Hugo:https://github.com/JakeWharton/hugo


Timber

This
is a logger with a small, extensible API which provides utility on top of Android's normal Log class.


Timbe:https://github.com/JakeWharton/timber


Mockito

Tasty mocking fram
ework forunit tests in Java


Mockito :https://github.com/mockito/mockito

最佳解析:http://www.oschina.net/translate/mockito-a-great-mock-framework-for-java-development


Robotium

Robotium是一款国外的Android自动化测试框架,主要针对Android平台的应用进行黑盒自动化测试,它提供了模拟各种手势操作(点击、长按、滑动等)、查找和断言机制的API,能够对各种控件进行操作。


Robotium:http://robotium.com/


Robolectric

Robolectric
is a testing framework that de-fangs the Android SDK so you can test-drive the development of your Android app.


Robolectric:https://github.com/robolectric/robolectric

最佳解析:https://segmentfault.com/a/1190000002904944


Stetho

Stetho is a sophisticated
debug bridge forAndroid applications.
When enabled, developers have access to the Chrome Developer Tools feature natively part of the Chrome desktop browser.
Developers can also choose to enable the optional dumpapp tool which offers a powerful command-line interface to application internals.


Stetho:http://facebook.github.io/stetho/

最佳解析:http://www.jianshu.com/p/03da9f91f41f


LeakCanary

A memory leak detection
library forAndroid and Java.


LeakCanary:https://github.com/square/leakcanary

最佳解析:http://www.jcodecraeer.com/a/anzhuokaifa/androidkaifa/2015/0509/2854.html


ACRA

ACRA is a library enabling Android Application to automatically post their crash reports to a GoogleDoc form.
It is targeted to android applications developers to help them get data from their applications when they crash or behave erroneously.


ACRA:https://github.com/ACRA/acra

Wiki:https://github.com/ACRA/acra/wiki/BasicSetup

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: