Android 開源項目android-open-project工具庫解析之(一) 依賴注入,圖片緩存,網絡相關,數據庫orm工具包,Android公共庫

1、依賴注入DI 

經過依賴注入下降View、服務、資源簡化初始化。事件綁定等反覆繁瑣工做
html

  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) RESTclient:定義client接口,本身主動生成REST請求的實現
    (5) 沒有你想象的複雜:AndroidAnnotations僅僅是在在編譯時生成對應子類
    (6) 不影響應用性能:僅50kb。在編譯時完畢,不會對執行時有性能影響。
    PS:與roboguice的比較:roboguice經過執行時讀取annotations進行反射,因此可能影響應用性能。而AndroidAnnotations在編譯時生成子類。因此對性能沒有影響 java

  2. roboguice
    幫你處理了很是多代碼異常,利用annotation使得更少的代碼完畢項目
    項目地址:https://github.com/roboguice/roboguice
    文檔介紹:https://github.com/roboguice/roboguice/wiki android

  3. butterknife
    利用annotation幫你高速完畢View的初始化,下降代碼
    項目地址:https://github.com/JakeWharton/butterknife
    文檔介紹:http://jakewharton.github.io/butterknife/ git

  4. Dagger
    依賴注入,適用於Android和Java
    項目地址:https://github.com/square/dagger
    文檔介紹:http://square.github.io/dagger/
    github

2、圖片緩存

  1. Android-Universal-Image-Loader
    圖片緩存。眼下使用最普遍的圖片緩存,支持主流圖片緩存的絕大多數特性。ajax


    項目地址: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模式 sql

  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)可依據系統配置初始化緩存等 shell

  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
    效果圖:Screen Shot文檔介紹:http://cube-sdk.liaohuqiu.net/ 數據庫

  5. fresco
    一款強大的圖片緩存工具,由 Facebook開發
    項目地址:https://github.com/facebook/fresco
    文檔介紹:http://frescolib.org/
    特色:(1) 兩個內存緩存加上磁盤緩存構成了三級緩存
    (2) 支持流式,可以相似網頁上模糊漸進式顯示圖片
    (3) 對多幀動繪圖片支持更好,如 Gif、WebP
    (4) 不少其它樣的顯示,如圓角、進度條、點擊重試、本身定義對焦點
    (5) 不少其它樣的載入,如支持 EXIF、全面支持 WebP
    (6) 支持 Android 2.3+

3、網絡相關

  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/androidqueryhttps://code.google.com/p/android-query/
    Demo地址:https://play.google.com/store/apps/details?

    id=com.androidquery
    文檔介紹:https://code.google.com/p/android-query/#Why_AQuery?


    特色: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

  10. Droppy
    支持多種樣式的下拉菜單
    項目地址:https://github.com/shehabic/Droppy

4、數據庫 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/square/retrofit 能保存從server獲取的數據
    項目地址:https://github.com/emilsjolander/sprinkles
    文檔介紹:http://emilsjolander.github.io/blog/2013/12/18/android-with-sprinkles/

  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

  7. DBFlow
    Android SQLite ORM工具庫。

    綜合了 Active Android, Schematic, Ollie,Sprinkles等庫的長處;經過註解實現,性能好;能生成ContentProvider。


    項目地址:https://github.com/Raizlabs/DBFlow
    文檔介紹:https://github.com/Raizlabs/DBFlow#usage-docs

5、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
    文檔介紹: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

  5. CleanAndroidCode
    整合了Dagger Otto AndroidAnnotations,方便高速開發
    項目地址:https://github.com/pyricau/CleanAndroidCode

  6. xUtils
    基於Afinal。包括DbUtils、ViewUtils、HttpUtils、BitmapUtils四大模塊,可用於高速開發
    項目地址:https://github.com/wyouflf/xUtils

  7. 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

  8. UltimateAndroid
    UltimateAndroid是一個高速開發Android應用的框架。框架眼下主要包括的功能有View Injection,ORM,異步網絡請求和圖片載入,本身主動化腳本測試,磁盤LRU等功能.同一時候提供了相似於TripleDes、Webview高速設置、Md5處理、String處理,Https處理等常常使用工具類,還有超過100多種UI控件效果。
    項目地址:https://github.com/cymcsg/UltimateAndroid
    官網網址:http://blog.marshalchen.com/UltimateAndroid/

  9. SAF
    SAF(Simple Android Framework)是一個簡單的android框架。它爲開發Android app提供了基礎性組件。


    項目地址:https://github.com/fengzhizi715/SAF
    官網網址:http://www.salesuite.cn/
    包含:(1)Event Bus(事件總線)
    (2) Rest Client(http的框架)
    (3) Image Cache(圖片緩存)
    (4) Dependency Injection(依賴注入)
    (5) Sqlite ORM(sqlite的orm)
    (6) Router(Activity、Fragment的Router)
    (7) Utils(各類常常使用的工具類)

  10. Barber
    Custom View 神器。經過簡單的註解幫助你大大下降 Custom View 中的代碼量。

    由於和 ButterKnife 同樣使用了 Annotation Proccessor ,因此對程序性能沒有影響。
    項目地址:https://github.com/hzsweers/barber

  11. device-year-class
    A library that analyzes an Android device's specifications and calculates which year the device would be considered "high end」.(facebook開發的檢測手機主流配置工具)
    項目地址:https://github.com/facebook/device-year-class

相關文章
相關標籤/搜索