http://blog.csdn.net/huangqili1314/article/details/72792682

主流第三方框架總結(結合2017年Android百大框架排行榜,按個人認識排序):
參考來源:http://www.cnblogs.com/jincheng-yangchaofan/articles/7018780.html
1. Retrofit
一句話介紹:Retrofit是一款類型安全的網絡框架,基于HTTP協議,服務于Android和java語言
上榜理由:Retrofit以21.8k的stars量雄踞github中android子標題榜首,第一當之無愧。
官網地址 http://square.github.io/retrofit/
https://github.com/square/retrofit
作者:square團隊
使用:
compile 'com.squareup.retrofit2:retrofit:2.3.0'
2.okhttp
一句話介紹:okhttp是一款基于HTTP和HTTP2.0協議的網絡框架,服務于java和android客戶端
上榜理由,okhttp以20.4k的stars量雄踞github中android子標題第二名。大型公司比如淘寶也封裝的是okhttp。Retrofit2.0開始內置okhttp框架,Retrofit專注封裝接口完成業(yè)務需求,okhttp專注網絡請求的安全高效,筆者將兩者區(qū)分開,是想讓后來學習者知道,這是兩套框架,學習框架原理時可以分開學習,以免理解混亂。
官網地址 http://square.github.io/okhttp/
github https://github.com/square/okhttp
作者:square團隊
使用:
compile 'com.squareup.okhttp3:okhttp:3.8.0'
3.Butter Knife
一句話介紹:Butter Knife所提供了一種能力——使用注解生成模板代碼,將view與方法和參數綁定。
上榜理由:github上16.5K個star,配合Androidstudio提供的Butter Knife插件,幫助開發(fā)者省卻了頻繁findviewbyid的煩惱,最新的Butter Knife還提供了onclick綁定以及字符串的初始化,初學者可以查閱Butter Knife以及Butter Knife插件進一步學習!
官網地址:http://jakewharton.github.io/butterknife/
github:https://github.com/JakeWharton/butterknife
作者:JakeWharton ,也是square團隊成員之一
使用:
dependencies {
compile 'com.jakewharton:butterknife:8.6.0'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.6.0'
}
5. glide
一句話介紹:glide是一款專注于提供流暢劃動能力的“圖片加載和緩存框架”
上榜理由:15.9k個star,圖片加載類框架排名第一的框架,google 在2014開發(fā)者大會上演示的camera app就是基于gilde框架開發(fā)的
github https://github.com/bumptech/glide
作者 Bump Technologies團隊
使用:
repositories {
mavenCentral()
}
dependencies {
compile 'com.github.bumptech.glide:glide:3.8.0'
compile 'com.android.support:support-v4:19.1.0'
}
8.EventBus
一句話介紹:EventBus是一款本地組件間通信框架
上榜理由:組件間通信框架star量第一:14.8k,在大型項目的Activities,fragments,Threads,Services都可以看到它的使用場景,盡管EventBus在向未創(chuàng)建的組件傳遞事件時有些局限,僅適合在“活著的”組件間傳遞消息,但仍不妨礙它活躍在各個大型項目各個場景里。
官網地址 http://greenrobot.org/eventbus/documentation/how-to-get-started/
github https://github.com/greenrobot/EventBus
作者 greenrobot
使用:
compile 'org.greenrobot:eventbus:3.0.0'
10.picasso
一句話介紹:強力的圖片下載、緩存框架
上榜理由:本榜單出現的第三款圖片類框架,不同的是picasso更強調圖片下載,你可以將picasso集成進你的項目中,你也可以結合gilde和UIL與picasso,三者一齊封裝至你的項目中,按需所用。
官網地址 http://square.github.io/picasso/
github https://github.com/square/picasso
作者 square團隊
使用:
compile 'com.squareup.picasso:picasso:2.5.2'
12.fresco
一句話介紹:一款可以管理圖片內存的框架
上榜理由:github上12.8k個star,圖片類排行榜第四名,facebook的出身證明了它并非是重復造的輪子,在管理圖片內存領域上有著它的一片天地,漸進式加載、加載gif都是它與前三位相比獨有的特性
官網地址: https://www.fresco-cn.org/
github https://github.com/facebook/fresco
作者 facebook
使用:
dependencies {
// 其他依賴
compile 'com.facebook.fresco:fresco:0.12.0'
}
下面的依賴需要根據需求添加:
dependencies {
// 在 API < 14 上的機器支持 WebP 時,需要添加
compile 'com.facebook.fresco:animated-base-support:0.12.0'
// 支持 GIF 動圖,需要添加
compile 'com.facebook.fresco:animated-gif:0.12.0'
// 支持 WebP (靜態(tài)圖+動圖),需要添加
compile 'com.facebook.fresco:animated-webp:0.12.0'
compile 'com.facebook.fresco:webpsupport:0.12.0'
// 僅支持 WebP 靜態(tài)圖,需要添加
compile 'com.facebook.fresco:webpsupport:0.12.0'
}
13.RxAndroid
一句話介紹:一款Android客戶端組件間異步通信的框架
上榜理由:github上12.7k個star,位居組件通信框架的第二名,僅在EventBus之后,如果要問兩者的區(qū)別,Eventbus是用來取代組件間繁瑣的interface,RxAndroid是用來取代AnsyTask的,并不沖突;當然RxAndroid的優(yōu)點并不僅限于此,更多優(yōu)雅的實現,可以去官網查閱!
github https://github.com/ReactiveX/RxAndroid
作者 JakeWharton
使用:
compile 'io.reactivex.rxjava2:rxandroid:2.0.1'
compile 'io.reactivex.rxjava2:rxjava:2.1.0'
18.androidannotations
一句話介紹:一款基于注解的快速開發(fā)框架
上榜理由:與Butterknife一樣基于注解,利用注解快速完成view的初始化,不同的是androidannotations提供了更多的能力:簡單的線程模型等;筆者只接觸過Butterknife,無法更進一步敘述androidannotations的優(yōu)勢,如果你志在深入了解注解的妙用,可以嘗試探索一下!
官網地址 http://androidannotations.org/
github https://github.com/androidannotations/androidannotations
作者: WonderCsabo
28.greenDAO
一句話介紹:greenDAO是一款高效、快速的SQLite型數據庫
上榜理由:greenDAO的star數量與Realm不相上下,且與EventBus師出同門,也是由greenrobot團隊開發(fā)維護的,質量有所保證,但若拷問筆者Realm與greenDao兩者的優(yōu)劣性,只能具體到實際使用當中,模擬線上的使用情形,進行高強度測試后才能下判斷,故在此不能一言兩語說完,深表遺憾
官網地址:http://greenrobot.org/greendao/
github https://github.com/greenrobot/greenDAO
使用:
buildscript {
repositories {
jcenter()
mavenCentral() // add repository
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.1'
classpath 'org.greenrobot:greendao-gradle-plugin:3.2.2' // add plugin
}
}
-----
apply plugin: 'com.android.application'
apply plugin: 'org.greenrobot.greendao' // apply plugin
dependencies {
compile 'org.greenrobot:greendao:3.2.2' // add library
}
48.RxJava-Android-Samples
一句話介紹:一款介紹RxJava使用場景的app
上榜理由:榜單出現的第一個“僅僅為告訴你如何使用另一個項目”的開源項目,它可以說是RxJava的用例,你想得到的想不到的RxJava用法這里都有,這就是為什么它以5.2k個star矗立在這份榜單里的原因。遺憾自己沒有創(chuàng)作這么一個受人追捧的demo?趕快動手寫個其他的“XX項目用例吧”
github https://github.com/kaushikgopal/RxJava-Android-Samples
作者:kaushikgopal
使用:
clone到本地慢慢探索吧
61.volley
一句話介紹:google推薦使用的Android端網絡請求框架
上榜理由:4.4k個star,并不是他不夠優(yōu)秀,而是使用volley已經漸漸成為廣大開發(fā)者的習慣
github h<a target="_blank">ttps://github.com/google/volley</a>(新版volley地址)
作者:google
使用:
clone源碼到本地
62.androidmvp
一句話介紹:一款展示Android端Mvp設計的demo
上榜理由:榜單里為數不多、僅憑展示某種設計模式就獲得4.2K個star的項目,如果你有嘗試mvp的打算,androidmvp可以作為你的前哨站
github https://github.com/antoniolg/androidmvp
作者:Antonio Leiva
使用:
clone到本地
復習資料參考:
一個帖子學會Android開發(fā)四大組件:https://www.cnblogs.com/pepcod/archive/2013/02/11/2937403.html
Android數據持久化存儲方式:http://blog.csdn.net/YvonneVon/article/details/53438147