Android常用库整理
生活随笔
收集整理的這篇文章主要介紹了
Android常用库整理
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
本文整理了安卓開發(fā)中常用的官方和三方庫及其官網(wǎng)地址,方便同仁們進(jìn)行查閱、技術(shù)選型和追更。這里羅列的庫一般是星級較高、可靠性較好、維護(hù)中的庫,所以在功能性、可靠性以及性能上通常是滿足需求的。在技術(shù)選型時建議從以下幾點進(jìn)行考量:
- 擴(kuò)展性:是否支持自定義功能拓展;
- 性能:是否需要極致性能要求;
- 安全性:是否具有安全漏洞;
- 技術(shù)支持:文檔是否完備,更新頻率等;
- 體積:是否對包體積具有極致要求;
如果有官方的庫建議使用官方的,維護(hù)有保障,當(dāng)然像square公司出品的幾乎也可以認(rèn)為是官方的了。
目錄
- AndroidX&Material
- 基礎(chǔ)庫
- 并發(fā)編程
- 數(shù)據(jù)解析
- 網(wǎng)絡(luò)請求
- 文件讀寫
- 輕量級存儲
- 數(shù)據(jù)庫
- 日志記錄
- 圖片加載
- 事件總線
- js通訊
- 其他
- 架構(gòu)
- 組件化
- 插件化
- AOP/IOC
- 依賴注入和插裝
- 插樁工具鏈
- 功能庫
- 控件庫
- 開放平臺SDK
AndroidX&Material
| appcompat | androidx.appcompat:appcompat:1.1.0 | – | Dialog/activity/actionbar/menu等 |
| cardview | androidx.cardview:cardview:1.0.0 | – | 卡片布局 |
| material | com.google.android.material:material:1.1.0 | – | 卡片布局 |
| lifecycle | androidx.lifecycle:lifecycle-extensions:2.2.0 | – | activity/fragment/service生命周期 |
| constraintlayout | androidx.constraintlayout:constraintlayout:1.1.3 | – | 相對布局 |
| coordinatorlayout | androidx.coordinatorlayout:coordinatorlayout:1.1.0 | – | 動畫框架布局 |
| swiperefreshlayout | androidx.swiperefreshlayout:swiperefreshlayout:1.1.0 | – | 下拉刷新 |
| viewpager | androidx.viewpager:viewpager:1.0.0 | – | viewpager |
| viewpager2 | androidx.viewpager2:viewpager2:1.0.0 | – | 基于recyclerview實現(xiàn)的viewpager |
| fragment | androidx.fragment:fragment:1.2.0 | – | fragment |
| activity | androidx.activity:activity:1.1.0 | – | activity |
| drawerlayout | androidx.drawerlayout:drawerlayout:1.0.0 | – | 側(cè)滑布局 |
| recyclerview | androidx.recyclerview:recyclerview:1.1.0 | – | 列表 |
| transition | androidx.transition:transition:1.2.0 | – | 轉(zhuǎn)場動畫 |
| loader | androidx.loader:loader:1.0.0 | – | 異步加載 |
| collection | androidx.collection:collection:1.1.0 | – | 經(jīng)優(yōu)化的List、Map、Set集合 |
| annotation | androidx.annotation:annotation:1.1.0 | – | 常用注解 |
| multidex | androidx.multidex:multidex:2.0.0 | – | 64K限制,minSDK21以下時需要手動導(dǎo)入 |
上面只列出了常見的,最全版本可以到這里查看
基礎(chǔ)庫
并發(fā)編程
| rxjava2 | io.reactivex.rxjava2:rxjava:2.2.5 io.reactivex.rxjava2:rxandroid:2.1.0 org.reactivestreams:reactive-streams:1.0.2 | github | rxjava2 |
數(shù)據(jù)解析
| fastjson | com.alibaba:fastjson:1.2.49 | github | json解析 |
| gson | com.google.code.gson:gson:2.8.5 | github | json解析 |
| jackson | com.fasterxml.jackson.core:jackson-core:2.8.9 com.fasterxml.jackson.core:jackson-annotations:2.8.0 com.fasterxml.jackson.core:jackson-databind:2.8.9 | github | json解析 |
| LoganSquare | classpath ‘com.neenbedankt.gradle.plugins:android-apt:1.8’ apply plugin: ‘com.neenbedankt.android-apt’ apt ‘com.bluelinelabs:logansquare-compiler:1.3.6’ compile ‘com.bluelinelabs:logansquare:1.3.6’ | github | json解析,編譯期生成代碼因此是靜態(tài)的 |
| simple-xml | org.simpleframework:simple-xml:2.7.1 | xml解析 | |
| jsoup | org.jsoup:jsoup:1.14.1-SNAPSHOT | github | html操作 |
網(wǎng)絡(luò)請求
| retrofit | com.squareup.retrofit2:retrofit:2.7.1 com.squareup.retrofit2:converter-gson:2.3.0 com.squareup.retrofit2:adapter-rxjava2:2.3.0 com.squareup.retrofit2:converter-simplexml:2.3.0 | github | 網(wǎng)絡(luò)請求 |
| okhttp | com.squareup.okhttp3:okhttp:3.14.4 com.squareup.okhttp3:okhttp-urlconnection:3.9.1 | github | 網(wǎng)絡(luò)請求 |
| Java-WebSocket | org.java-websocket:Java-WebSocket:1.5.1 | github | WebSocket |
| android-async-http | com.loopj.android:android-async-http:1.4.11 | github | 網(wǎng)絡(luò)請求 |
| volley | com.android.volley:volley:1.2.1-SNAPSHOT | github | 網(wǎng)絡(luò)請求、圖片加載 |
| NoHttp | com.yanzhenjie.nohttp:nohttp:1.1.11 | github | 網(wǎng)絡(luò)請求 |
| Novate | com.tamic.novate:novate:1.5.5 | github | 網(wǎng)絡(luò)請求 |
文件讀寫
| okio | com.squareup.okio:okio:1.17.4 | 文件IO |
輕量級存儲
| MMKV | com.tencent:mmkv-static:1.2.10 | github | kv存儲,基于mmap |
數(shù)據(jù)庫
| litepal | org.litepal.android:java:3.2.3 org.litepal.android:core:3.2.3 | github | 數(shù)據(jù)庫 |
| activeandroid | com.michaelpardo:activeandroid:3.1.0-SNAPSHOT | github | 數(shù)據(jù)庫 |
| ormlite-android | com.j256.ormlite:ormlite-android:5.7-SNAPSHOT | github | 數(shù)據(jù)庫 |
| greendao | classpath ‘org.greenrobot:greendao-gradle-plugin:3.3.0’ apply plugin: ‘org.greenrobot.greendao’ implementation ‘org.greenrobot:greendao:3.3.0’ | github | 數(shù)據(jù)庫 |
| realm | classpath “io.realm:realm-gradle-plugin:10.7.0-SNAPSHOT” apply plugin: ‘realm-android’ compileOnly ‘org.projectlombok:lombok:1.16.18’ compileOnly ‘javax.annotation:javax.annotation-api:1.3.1’ annotationProcessor ‘org.projectlombok:lombok:1.16.18’ | github | 數(shù)據(jù)庫,雖然性能不錯,但是包體積很大 |
日志記錄
| logger | com.orhanobut:logger:2.2.0 | github | 日志 |
| timber | com.jakewharton.timber:timber:4.7.1 | github | 日志,價值在于日志類的抽象 |
| LogUtils | com.apkfuns.logutils:library:1.7.5 | github | 日志,功能比較完備 |
| xLog | com.elvishew:xlog:1.10.0 | github | 日志 |
| Log4a | com.github.pqpo:Log4a:1.4.2 | github | 日志,基于mmap |
| mars | com.tencent.mars:mars-wrapper:1.2.5 或者com.tencent.mars:mars-core:1.2.5 | github | 高性能日志 |
| xCrash | com.iqiyi.xcrash:xcrash-android-lib:3.0.0 | github | java/native奔潰日志 |
圖片加載
| glide | com.github.bumptech.glide:glide:4.9.0 com.github.bumptech.glide:gifdecoder:4.9.0 com.github.bumptech.glide:disklrucache:4.9.0 com.github.bumptech.glide:annotations:4.9.0 com.github.bumptech.glide:compiler:4.9.0 | github | 圖片加載 |
| glide-transformations | jp.wasabeef:glide-transformations:4.0.0 jp.co.cyberagent.android:gpuimage:2.0.4 | glide拓展 | |
| picasso | com.squareup.picasso:picasso:2.71828 | github | 圖片加載 |
| fresco | com.facebook.fresco:fresco:2.5.0 | github | 圖片加載,體積較大 |
| Android-Universal-Image-Loader | com.nostra13.universalimageloader:universal-image-loader:1.9.5 | github | 圖片加載 |
事件總線
| eventbus | org.greenrobot:eventbus:3.1.1 | github | 事件總線 |
| eventbus | org.simple:androideventbus:1.0.5.1 | github | 事件總線,不再維護(hù) |
| otto | com.squareup:otto:1.3.8 | github | 事件總線,不再維護(hù) |
js通訊
| jsbridge | com.github.lzyzsd:jsbridge:1.0.4 | github | js通訊,不再維護(hù) |
| DSBridge-Android | com.github.wendux:DSBridge-Android:3.0-SNAPSHOT or x5: com.github.wendux:DSBridge-Android:x5-3.0-SNAPSHOT | github | js通訊 |
| AgentWeb | implementation ‘com.github.Justson.AgentWeb:agentweb-core:v4.1.9-androidx’ // (必選) implementation ‘com.github.Justson.AgentWeb:agentweb-filechooser:v4.1.9-androidx’ // (可選) implementation ‘com.github.Justson:Downloader:v4.1.9-androidx’ // (可選) | github | h5容器 |
其他
| utilcode | com.blankj:utilcode:1.30.0 | github | SDK封裝,也支持事件總線、日志記錄、并發(fā)編程等 |
架構(gòu)
組件化
| ARouter | classpath “com.alibaba:arouter-register:1.0.2” compile ‘com.alibaba:arouter-api:1.5.2’ annotationProcessor ‘com.alibaba:arouter-compiler:1.5.2’ | github | SDK封裝,也支持事件總線、日志記錄、并發(fā)編程等 |
插件化
AOP/IOC
依賴注入和插裝
| dagger | com.google.dagger:dagger-android:2.x com.google.dagger:dagger-android-processor:2.x | github | 依賴注入 |
| androidannotations | org.androidannotations:androidannotations:version org.androidannotations:androidannotations-api:version | github | 依賴注入 |
| hunter-okhttp | com.quinn.hunter:hunter-okhttp-library:0.8.5 插件:com.quinn.hunter:hunter-okhttp-plugin:0.9.2 | github | okhttp鉤子 |
| xHook | 無 | github | native鉤子 |
| aspectjx | classpath ‘com.hujiang.aspectjx:gradle-android-plugin-aspectjx:2.0.8’ | github | 增強(qiáng)版aspectj |
插樁工具鏈
| javapoet | com.squareup:javapoet:1.7.0 | java文件生成 | |
| kotlinpoet | com.squareup:kotlinpoet:1.9.0 | github | kotlin文件生成 |
| javassist | org.javassist:javassist:3.28.0-GA | github | java、字節(jié)碼 |
| asm | org.ow2.asm:asm:9.2 | 官網(wǎng) | 字節(jié)碼 |
| aspectj | org.aspectj:aspectjweaver:1.9.7 | 官網(wǎng) github | java |
功能庫
| keeplive | com.fanjun:keeplive:1.1.20 | 應(yīng)用層進(jìn)程?;?/td> | |
| permission | com.yanzhenjie.permission: x:2.0.1 | 動態(tài)權(quán)限 | |
| rxpermissions | com.tbruyelle.rxpermissions2:rxpermissions:0.9.5 | 動態(tài)權(quán)限 | |
| rxlifecycle-android | com.trello.rxlifecycle2:rxlifecycle-android:2.2.1 | rx生命周期 | |
| zxing | com.google.zxing:core:3.3.3 com.google.zxing:android-core:3.3.0 | github | 二維碼編解碼 |
| jjwt | io.jsonwebtoken:jjwt:0.9.0 | github | token工具 |
| pinyin4j | com.belerweb:pinyin4j:2.5.0 | github | 拼音 |
| tinypinyin | com.github.promeg:tinypinyin:2.0.3 com.github.promeg:tinypinyin-android-asset-lexicons:2.0.3 com.github.promeg:tinypinyin-lexicons-android-cncity:2.0.3 | github | 拼音 |
| PersistentCookieJar | com.github.franmontiel:PersistentCookieJar:v1.0.1 | github | cookie持久化 |
| Matisse | com.zhihu.android:matisse:0.5.3-beta3 | github | 圖片選擇 |
| easyexcel | com.alibaba:easyexcel:2.2.10 | github | Excel操作 |
| dexmaker | com.linkedin.dexmaker:dexmaker-mockito:2.28.1 | github | class代理 |
| FingerprintIdentify | com.github.uccmawei:FingerprintIdentify:1.2.6 | github | 指紋識別封裝 |
控件庫
| qmui | com.qmuiteam:qmui:1.4.4 | github | 基礎(chǔ)控件庫 |
| bga-banner | cn.bingoogolapple:bga-banner:3.0.0 | banner輪播圖 | |
| materialrefreshlayout | com.cjj.materialrefreshlayout:library:1.3.0 | 下拉刷新 | |
| SmartRefreshLayout | com.scwang.smartrefresh:SmartRefreshLayout:1.1.0 | github | 下拉刷新&加載更多 |
| recyclerview | com.yanzhenjie.recyclerview: x:1.3.2 | 增強(qiáng)recyclerview :loadmore、sticky、側(cè)滑菜單等 | |
| recyclerview | com.github.CymChad:BaseRecyclerViewAdapterHelper:2.9.46 | 增強(qiáng)recyclerview :通用adapter | |
| ultimaterecyclerview | com.marshalchen.ultimaterecyclerview:library:0.9.0 | github | 增強(qiáng)recyclerview:可折疊 |
| recyclerview-animators | jp.wasabeef:recyclerview-animators:4.0.2 | github | recyclerview 動畫 |
| easyrecyclerview | com.jude:easyrecyclerview:4.4.2 | 增強(qiáng)recyclerview | |
| PhotoView | com.github.chrisbanes:PhotoView:2.1.4 | 圖片縮放 | |
| photoview | com.github.chrisbanes.photoview:library:1.2.4 | 圖片縮放 | |
| imagezoom | it.sephiroth.android.library.imagezoom:library:1.0.4 it.sephiroth.android.library.easing:library:1.0.2 | 圖片縮放 | |
| android-pdf-viewer | com.github.barteksc:android-pdf-viewer:2.8.2 com.github.barteksc:pdfium-android:1.7.1 | PDF預(yù)覽(有高級安全漏洞不建議實用) | |
| ticketview: | com.vipulasri:ticketview:1.0.7 | 仿票據(jù)背景布局 | |
| flowlayout-lib | com.hyman:flowlayout-lib:1.1.2 | 流式布局 | |
| flexbox | com.google.android:flexbox:1.1.0 | 流式布局&recyclerview拓展 | |
| loading | com.yanzhenjie:loading:1.0.2 | 加載動畫 | |
| LoadingDrawable | 無 | github | 加載動畫,不再維護(hù)但是我個人非常推崇drawable形式 |
| gridPasswordView | com.jungly:gridPasswordView:0.3 | github | 密碼、短信驗證碼輸入框 |
| NotifyUtil | 無 | github | 玩轉(zhuǎn)安卓通知欄通知 |
| ExpansionPanel | com.github.florent37:expansionpanel:1.2.4 | github | 動畫展開/收起容器 |
| VerticalTabLayout | q.rorbin:VerticalTabLayout:1.2.5 | github | 縱向tablayout |
| Skeleton | com.ethanhua:skeleton:1.1.2 io.supercharge:shimmerlayout:2.1.0 | github | 骨架加載 |
| XPopup | com.github.li-xiaojun:XPopup:2.4.3 | github | 彈窗框架 |
| NewbieGuide | com.github.huburt-Hu:NewbieGuide:v2.4.0 | github | 引導(dǎo)頁 |
| lottie-android | com.airbnb.android:lottie:3.7.1-SNAPSHOT | github | 引導(dǎo)頁 |
開放平臺SDK
| 未上傳到倉庫 | https://connect.qq.com | QQ互聯(lián)SDK | |
| ddsharesdk | com.alibaba.android:ddsharesdk:1.1.0 | https://ding-doc.dingtalk.com/ | 釘釘分享 |
| wechat-sdk-android | com.tencent.mm.opensdk:wechat-sdk-android-without-mta:5.3.1 | https://open.weixin.qq.com/ | 微信開發(fā)SDK |
| gms | com.google.android.gms:play-services-measurement-api:17.2.0 com.google.android.gms:play-services-base:17.0.0 com.google.android.gms:play-services-tasks:17.0.0 com.google.android.gms:play-services-measurement:17.2.0 com.google.android.gms:play-services-measurement-sdk:17.2.0 com.google.android.gms:play-services-measurement-impl:17.2.0 com.google.android.gms:play-services-stats:17.0.0 com.google.android.gms:play-services-measurement-sdk-api:17.2.0 com.google.android.gms:play-services-measurement-base:17.2.0 com.google.android.gms:play-services-ads-identifier:17.0.0 com.google.android.gms:play-services-basement:17.0.0 | https://firebase.google.com/docs/android | 谷歌FCM推送 |
| firebase | com.google.firebase:firebase-messaging:20.0.0 com.google.firebase:firebase-core:17.2.0 com.google.firebase:firebase-analytics:17.2.0 com.google.firebase:firebase-iid:20.0.0 com.google.firebase:firebase-common:19.0.0 com.google.firebase:firebase-iid-interop:17.0.0 com.google.firebase:firebase-measurement-connector:18.0.0 | https://firebase.google.cn/ | 谷歌firebase |
| umeng | com.umeng.umsdk:push:6.0.1 com.umeng.umsdk:asms:1.1.3 com.umeng.umsdk:common:9.1.0 com.umeng.umsdk:crash:0.0.4 com.umeng.umsdk:oaid_vivo:1.0.0.1 com.umeng.umsdk:oaid_oppo:1.0.4 com.umeng.umsdk:oaid_mi:1.0.0 com.umeng.umsdk:oaid_lenovo:1.0.0 | https://www.umeng.com/push | 友盟推送 |
總結(jié)
以上是生活随笔為你收集整理的Android常用库整理的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 求n的阶乘【VB代码实现】
- 下一篇: Android4,flutter插件引用