UI個性化控件
Index
- Dependency Injections
- Networking
- Image Loader
- O/R Mapping
- Event Buses
- JSON
- Background Processing
- Image Processing
- Camera
- Video
- Logging
- Android Plugin
- Security
- Showcases
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:
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:
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
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