Android开源框架简介

来源:互联网 发布:免费淘宝模板代码 编辑:程序博客网 时间:2024/05/22 04:24

前言

以下为比较常用的开源库,使用有利于提高项目的开发效率。

图片加载库

Fresco

Fresco是Facebook推出的图片加载框架,可以有效避免内存溢出的发生。
特性:内存管理,图片的渐进式呈现,支持加载Gif图,支持WebP格式。
项目地址:https://github.com/facebook/fresco。

Glide

Glide是一个 Android 上的图片加载和缓存库,其目的是实现平滑的图片列表滚动效果。
项目地址 :https://github.com/bumptech/glide。

Universal-Image-Loader

是一个开源的UI组件程序,该项目的目的是提供一个可重复使用的仪器为异步图像加载,缓存和显示。
项目地址:https://github.com/nostra13/Android-Universal-Image-Loader。

Picasso

Picasso是Square公司开源的一个Android图形缓存库,可以实现图片下载和缓存功能。
项目地址:https://github.com/square/picasso。

网络加载库

Volley

Volley是Google推出的Android异步网络请求框架和图片加载框架,在Google I/O 2013大会上发布。
项目地址:https://android.googlesource.com/platform/frameworks/volley。

android-async-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

OkHttp

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

Retrofit

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

数据解析库

Gson

Gson的@Expose注解和@SerializedName注解
@Expose标签包含两个属性:
1、deserialize (boolean) 反序列化 默认 true
2、serialize (boolean) 序列化 默认 true
使用new GsonBuilder().excludeFieldsWithoutExposeAnnotation().create();创建Gson对象,没有@Expose注释的属性将不会被序列化
@SerializedName标签定义属性序列化后的名字
项目地址:https://github.com/google/gson

异步消息

EventBus

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

RxJava & RxAndroid

Rx并不是一种新的语言,而是一种普通的Java模式,类似于观察者模式,可以将它看作一个普通的Java类库。RxAndroid是RxJava的一个针对Android平台的扩展,主要用于Android开发。
相关文章:《深入浅出RxJava》系列。
项目地址:
https://github.com/ReactiveX/RxJava
https://github.com/ReactiveX/RxAndroid

注解库

Bufferknife

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

Dagger

Dagger是构建在Android annotations基础上的,属于Android的依赖注入框架。
Dagger没有采用反射技术,而是用预编译技术,因为基于反射的依赖注入非常耗资源。
项目地址:https://github.com/square/dagger。

RoboGuice

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

数据库

greenDAO

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

Realm

Realm是一个可以替代SQLite以及ORMlibraries的轻量级数据库。
相比SQLite,Realm更快并且具有很多现代数据库的特性,比如支持JSON,流式api,数据变更通知,以及加密支持,这些都为安卓开发者带来了方便。
项目地址:https://github.com/realm/realm-java

ActiveAndroid

ActiveAndroid是一个活跃的记录风格的ORM(对象关系映射)库。ActiveAndroid可以让您保存和检索的SQLite数据库记录而没有写一个SQL语句。每个数据库记录被整齐包裹成一个model类,像insert()和delete()。
项目地址:https://github.com/pardom/ActiveAndroid

开源项目推荐

philm

Movie collection and information app for Android.
项目地址:https://github.com/chrisbanes/philm

plaid

项目地址:https://github.com/nickbutcher/plaid

android-UniversalMusicPlayer

项目地址:https://github.com/googlesamples/android-UniversalMusicPlayer

文章内容多来自其他博客或文章,如有侵权,请联系并删除。

原创粉丝点击