Android中經常使用的優秀開源框架

Android開源框架庫分類,挑選出最經常使用,最實用的開源項目,本篇主要介紹的是優秀開源框架庫和項目,UI個性化控件會獨立介紹。
UI個性化控件

Index

Dependency Injections

AndroidAnnotations

Repositoryhttps://github.com/excilys/androidannotations
DescriptionAndroid快速開發框架。
Features:html

  • 依賴注入:包括view,extras,系統服務,資源等等
  • 簡單的線程模型,經過annotation表示方法運行在ui線程仍是後臺線程
  • 事件綁定:經過annotation表示view的響應事件,不用在寫內部類
  • REST客戶端:定義客戶端接口,自動生成REST請求的實現
  • 沒有你想象的複雜:AndroidAnnotations只是在在編譯時生成相應子類
  • 不影響應用性能:僅50kb,在編譯時完成,不會對運行時有性能影響。

PS:與roboguice的比較:roboguice經過運行時讀取annotations進行反射,因此可能影響應用性能,而AndroidAnnotations在編譯時生成子類,因此對性能沒有影響。java

Butter Knife

Repositoryhttps://github.com/JakeWharton/butterknife
Description: JakeWharton的開源做品,利用annotation幫你快速完成View的初始化,減小代碼。
Features:mysql

  • 支持 Activity 中的 View 注入
  • 支持 View 中的 View 注入
  • 支持 View 事件回調函數注入

Dagger

Repositoryhttps://github.com/square/dagger
Description: sqaure開源的依賴注入框架,是Guice的一個子集,更輕量,更適合在Android平臺使用。
Features:android

  • 使用 JSR-330標準註解進行構造器注入
  • 使用@Provides註解建立對象
  • 針對依賴樹的中心上下文
  • 昂貴資源延遲注入
  • 同一接口的多種實現
  • 靜態注入 (針對遺留環境)
  • 綁定的編譯時驗證

依賴注入框架的對比:dagger-and-butter-knife-vs-android-annotations,依賴注入淺析ios

Networking

Android Lite Http

Repositoryhttps://github.com/litesuits/android-lite-http
Description: 一款‘智能’的HTTP框架類庫。國人開發的一套框架。
Features:git

  • 單線程,全部方法都基於一個線程,毫不會跨線程,多線程的事情交給它自帶的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

Repositoryhttps://github.com/loopj/android-async-http
Description: Android異步Http請求
Used By:github

Features:算法

  • 在匿名回調中處理請求結果
  • 在UI線程外進行http請求
  • 請求使用ThreadPool來處理並不是資源的使用
  • 文件斷點上傳
  • 智能重試
  • 默認gzip壓縮
  • 內置Json解析
  • 可將Cookies持久化到SharedPreferences
  • More

Async Http Client

Repositoryhttps://github.com/AsyncHttpClient/async-http-client
DescriptionJava異步Http和WebSocket請求。使用NIO實現異步操做,默認的異步實現是基於Netty之上。sql

HttpCache

Repositoryhttps://github.com/Trinea/AndroidCommon
DescriptionTrinea大神寫的Http緩存工具。
Features:數據庫

  • 根據cache-control、expires緩存http請求
  • 支持同步、異步Http請求
  • 在匿名回調中處理請求結果
  • 在UI線程外進行http請求
  • 默認gzip壓縮

Http Request

Repositoryhttps://github.com/kevinsawicki/http-request
DescriptionJava HTTP請求庫。

Ion

Repositoryhttps://github.com/koush/ion
Description: Android異步網絡和圖片加載. Used Byhttps://github.com/koush/ion#projects-using-ion
Featureshttps://github.com/koush/ion#features

OkHttp

Repositoryhttps://github.com/square/okhttp
Description: Square開源的http庫,支持http和spdy協議.
Features:

  • 支持HTTP2和SPDY
  • 若是SPDY不可用,利用鏈接池減小請求延遲
  • 使用GZIP壓縮
  • Response緩存減小沒必要要的請求

Retrofit

Repositoryhttps://github.com/square/retrofit
Description: Square開源的Android和Java的REST風格請求庫.

Volley

Repositorygoogle volley | https://github.com/mcxiaoke/android-volley
Description: Google提供的網絡通訊庫,使得網絡請求更簡單、更快速
Features:

  • JSON,圖像等的異步下載
  • 網絡請求的排序
  • 網絡請求的優先級處理
  • 緩存
  • 多級別取消請求
  • 和Activity和生命週期的聯動(Activity結束時同時取消全部網絡請求)
  • More

Volley OkHttp Android

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

Image Loader

Fresco

Repository:

Description: Facebook 開源的一個強大的圖片加載組件。
Features:

  • 內存管理,兩個內存緩存加上磁盤緩存構成了三級緩存
  • 支持流式,圖片的漸進式呈現
  • 支持Gif圖和WebP格式
  • 更多樣的顯示,如圓角、進度條、點擊重試、自定義對焦點
  • 支持Android2.3+

Cube SDK

Repositoryhttps://github.com/etao-open-source/cube-sdk
Description: 一淘開源的一款Android開發包,包括圖片加載和網絡請求服務,綜合了Android-Universal-Image-Loader和square等組件優勢。
Features:

  • 使用簡單
  • 加載速度快,節省資源
  • 方便定製和改造
  • 圖片複用
  • 只關注請求結果,專一於業務
  • 請求緩存 / 本地預設請求數據
  • 簡單的JsonData,輕鬆訪問接口數據
  • 基於Fragment的UI框架
  • 屏幕尺寸信息
  • 網絡狀態信息

Glide

Repositoryhttps://github.com/bumptech/glide
Description: 一個高效、開源、 Android設備上的媒體管理框架。靈活的API,能夠和不少網絡框架進行整合。
Features:

  • GIF動畫的解碼
  • 本地視頻劇照的解碼
  • Activity生命週期的集成
  • 轉碼的支持
  • 動畫的支持
  • OkHttp和Volley的支持
  • 其餘功能:圖片加載過程當中佔位符等

ImageCache

Repositoryhttps://github.com/Trinea/AndroidCommon
Description: Trinea開源的圖片緩存,包含內存和Sdcard緩存。 Features:

  • 支持預取新圖片,支持等待隊列
  • 包含二級緩存,可自定義文件名保存規則
  • 可選擇多種緩存算法(FIFO、LIFO、LRU、MRU、LFU、MFU等13種)或自定義緩存算法
  • 可方便的保存及初始化恢復數據
  • 支持不一樣類型網絡處理
  • 可根據系統配置初始化緩存等

Picasso

Repositoryhttps://github.com/square/picasso
Description: square開源的圖片緩存。
Features:

  • 能夠自動檢測adapter的重用並取消以前的下載
  • 圖片變換
  • 能夠加載本地資源
  • 能夠設置佔位資源
  • 支持debug模式

Universal Image Loader for Android

Repositoryhttps://github.com/nostra13/Android-Universal-Image-Loader
Description: 應該是使用最多的圖片緩存,支持主流圖片緩存的絕大多數特性。
Features:

  • 多線程圖片加載(同步或者異步)
  • 儘量多的配置選項(線程池,加載器,解析器,內存/磁盤緩存,顯示參數等等)
  • 圖片能夠緩存在內存中,或者設備文件目錄下,或者SD卡中
  • 能夠監聽加載進度
  • 能夠自定義顯示每一張圖片時都帶不一樣參數
  • 支持Widget

Used By:
Applications using

O/R Mapping

5個推薦的orm框架

ActiveAndroid

Repositoryhttps://github.com/pardom/ActiveAndroid
Description: ActiveAndroid是一個輕量級的orm框架,名稱命令方式相似於Yii、Rails等使用的orm框架ActiveRecord。

GreenDAO

Repositoryhttps://github.com/greenrobot/greenDAO
Description: GreenDAO是一個輕量級,快速的orm框架。簡化建表、查詢、更新、插入、事務、索引的操做。
Features:

  • 性能突出(比ormlite快4-5倍), performance
  • 庫小,核心包小於100k
  • 簡單易用的API
  • 支持protobuf
  • 自動生成數據庫訪問代碼

OrmLite-Android

Repositoryhttps://github.com/j256/ormlite-android
Description: OrmLite不是Android平臺專用的orm框架,它是一個Java orm,OrmLite For Android增長了對Android平臺的支持。

Realm

Repositoryhttps://github.com/realm/realm-java
Description: 移動端的數據庫,適用於 Phone、Tablet、Wearable,支持 ORM,線程安全、支持連表及數據庫加密,比 SQLite 性能更好。
Features:

  • 着重移動端
  • 簡單易用的API
  • 支持線程安全,關係數據庫和加密
  • 訪問快速
  • 跨平臺

Sugar ORM

Repositoryhttps://github.com/satyan/sugar
Description: Android平臺專用orm框架。
Features:

  • 配置少
  • 自動生成表結構
  • 支持在不一樣模式版本直接切換

Event Buses

EventBus

Repositoryhttps://github.com/greenrobot/EventBus Description: 事件總線框架,非註解,效率很是高,這裏是和square的otto的對比
Features:

  • 非註解
  • 便利,以onEvent方法來接收
  • 性能優化,是android上最快的事件總線框架
  • 單例
  • 事件繼承

Otto

Repositoryhttps://github.com/square/otto
Description: Square開源的事件總線框架,在Guava基礎上增強,基於註解形式。

AndroidEventBus

Repositoryhttps://github.com/bboyfeiyu/AndroidEventBus
Descriptionbboyfeiyu開源的事件總線框架,吸取了greenrobot的EventBus以及square的otto的優勢,並在此基礎上作出了相應的改進,使得事件總線框架更適合用戶的使用習慣,也使得事件的投遞更加的精準、靈活。

JSON

fastjson

Repositoryhttps://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

Repositoryhttps://github.com/google/gson
Description: google開源的JSON解析庫

Jackson

Repositoryhttps://github.com/FasterXML/jackson-core
Description: Jackson能夠輕鬆的將Java對象轉換成json對象和xml文檔,一樣也能夠將json、xml轉換成Java對象

Moshi

Repositoryhttps://github.com/square/moshi
Description: square開源的JSON庫,與GSON相比,更少的內建類型,更少的配置,安全的html轉義等。

Background Processing

Bolts-Android

Repositoryhttps://github.com/BoltsFramework/Bolts-Android
Description: Parse發佈的面向Android的底層庫集合,參見parse-announces-bolts

android-priority-jobqueue

Repositoryhttps://github.com/path/android-priority-jobqueue
Description: Path開源的android優先級任務隊列框架。

Image Processing

android-gpuimage

Repositoryhttps://github.com/path/android-priority-jobqueue
Description: GPUImage是個功能十分強大、又十分易用的圖像處理庫。提供各類各樣的圖像處理濾鏡,而且支持照相機和攝像機的實時濾鏡。

ImageFilterForAndroid

Repositoryhttps://github.com/daizhenjun/ImageFilterForAndroid
Description: 國內的代震軍開源的濾鏡效果框架。

Camera

cwac-camera

Repositoryhttps://github.com/commonsguy/cwac-camera
Description: commonsguy開源的camera操做封裝。

SquareCamera

Repositoryhttps://github.com/boxme/SquareCamera
Description: 正方的攝像機,有先後攝像頭等操做。

CameraModule

Repositoryhttps://github.com/Yalantis/CameraModule
Description: Yalantis開源的攝像機,有自動聚焦功能等。

OpenCamera

Repositoryhttps://github.com/almalence/OpenCamera
Description: 完整的攝像機,功能很全,不過代碼有點亂。

StickerCamera

Repositoryhttps://github.com/Skykai521/StickerCamera
Description: 這是一款集成了相機,圖片裁剪,給圖片貼貼圖打標籤的相機應用。

Video

AndroidFFmpeg

Repositoryhttps://github.com/appunite/AndroidFFmpeg
Description: FFmpeg視頻解析的例子。

Vitamio

Repositoryhttps://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

Repositoryhttps://github.com/orhanobut/logger
Description: 簡單、美觀並且十分強大的 Android 日誌工具。

DebugLog

Repositoryhttps://github.com/MustafaFerhan/DebugLog
Description: 能夠幫你建立更簡單和更容易理解的調試日誌,可以友好的顯示調試信息所在類和函數。

hugo

Repositoryhttps://github.com/JakeWharton/hugo
Description: 用於打印函數信息及執行時間的工具,僅在 debug 模式生效。

Android Plugin

AndroidDynamicLoader

Repositoryhttps://github.com/mmin18/AndroidDynamicLoader
Description: 點評的插件化實現方式,是用 Fragment 以及 Schema 的方式實現。

dynamic-load-apk

Repositoryhttps://github.com/singwhatiwanna/dynamic-load-apk
Description: Apk動態加載框架,熱部署,利用 ClassLoader 以及 Activity 代理的方式解決。

android-pluginmgr

Repositoryhttps://github.com/houkx/android-pluginmgr
Description: 一種無須規範限制的動態加載解決方案,插件不須要依賴任何API
Features:

  • 插件爲普通apk,無須依賴任何jar
  • Activity生命週期由系統本身管理
  • 使用簡單,只須要了解一個類PluginManager的兩個方法
  • 啓動Activity的效率高
  • 不修改插件,被加載的插件仍然能夠獨立安裝。

Security

Conceal

Repositoryhttps://github.com/facebook/conceal
Description: Conceal是一套用於Android上的文件加密和鑑權的Java API

SQLCipher

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

Showcases

PocketHub

Repositoryhttps://github.com/pockethub/PocketHub
Description: Github 的 Android 客戶端項目

iosched

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

Cheesesquare

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

muzei

Repositoryhttps://github.com/romannurik/muzei
Description: 定時更換桌面精美壁紙

u2020

Repositoryhttps://github.com/JakeWharton/u2020
Description: 開源框架集成的demo

相關文章
相關標籤/搜索