Android常用库之遇见你真舒心
epdj6058
8年前
<p>这篇文章是5月份写创业项目的时候整理的,由于当时是快速开发,所以用到一些现成的开源库,整理起来方便自己和大家。</p> <h2><strong>系统框架</strong></h2> <h2><strong>1. 网络请求</strong></h2> <table> <thead> <tr> <th>名称</th> <th>描述</th> </tr> </thead> <tbody> <tr> <td><a href="/misc/goto?guid=4958988891673756696" rel="nofollow,noindex">Android Async HTTP</a></td> <td>Android异步HTTP库</td> </tr> <tr> <td><a href="/misc/goto?guid=4958988894919419400" rel="nofollow,noindex">AndroidAsync</a></td> <td>异步Socket,HTTP(客户端+服务器),WebSocket,和socket.io库。基于NIO而不是线程。</td> </tr> <tr> <td><a href="/misc/goto?guid=4958964956476581901" rel="nofollow,noindex">Okhttp</a></td> <td>Http与Http/2的客户端</td> </tr> <tr> <td><a href="/misc/goto?guid=4958964956869128717" rel="nofollow,noindex">Retrofit</a></td> <td>okhttp再封装</td> </tr> <tr> <td><a href="/misc/goto?guid=4958837203529529844" rel="nofollow,noindex">Volley</a></td> <td>Google推出的Android异步网络请求框架和图片加载框架</td> </tr> </tbody> </table> <h2><strong>2. 网络解析</strong></h2> <ul> <li> <p>JSON解析</p> </li> </ul> <table> <thead> <tr> <th>名称</th> <th>描述</th> </tr> </thead> <tbody> <tr> <td><a href="/misc/goto?guid=4958964956010997959" rel="nofollow,noindex">Gson</a></td> <td>一个Java序列化/反序列化库,可以将JSON和java对象互相转换</td> </tr> <tr> <td><a href="/misc/goto?guid=4959723175925009405" rel="nofollow,noindex">Jackson</a></td> <td>Jackson可以轻松地将Java对象转换成json对象和xml文档,同样也可以将json、xml转换成Java对象</td> </tr> <tr> <td><a href="/misc/goto?guid=4958988893478698129" rel="nofollow,noindex">fastjson</a></td> <td>fastjson是阿里出的一款超快的解析库</td> </tr> </tbody> </table> <ul> <li> <p>HTML解析</p> </li> </ul> <table> <thead> <tr> <th>名称</th> <th>描述</th> </tr> </thead> <tbody> <tr> <td><a href="/misc/goto?guid=4959723176114826505" rel="nofollow,noindex">Htmlparser</a></td> <td>解析单个独立html或嵌套html</td> </tr> <tr> <td><a href="/misc/goto?guid=4958874642818682344" rel="nofollow,noindex">Jsoup</a></td> <td>一个以最好的DOM,CSS和jQuery解析html的库</td> </tr> </tbody> </table> <h2><strong>3.图片加载</strong></h2> <table> <thead> <tr> <th>名称</th> <th>描述</th> </tr> </thead> <tbody> <tr> <td><a href="/misc/goto?guid=4958532889178784950" rel="nofollow,noindex">Android-Universal-Image-Loader</a></td> <td>强大的加载,缓存,展示图片的库</td> </tr> <tr> <td><a href="/misc/goto?guid=4958972548258164558" rel="nofollow,noindex">Picasso</a></td> <td>强大的图片下载与缓存的库</td> </tr> <tr> <td><a href="/misc/goto?guid=4958869680969840391" rel="nofollow,noindex">Fresco</a></td> <td>再也不怕OOM的图片加载库(力荐)</td> </tr> <tr> <td><a href="/misc/goto?guid=4958862736295244246" rel="nofollow,noindex">Glide</a></td> <td>图片加载和缓存的库</td> </tr> </tbody> </table> <h2><strong>4.数据处理</strong></h2> <table> <thead> <tr> <th>名称</th> <th>描述</th> </tr> </thead> <tbody> <tr> <td><a href="/misc/goto?guid=4959723176422567688" rel="nofollow,noindex">Ormlite</a></td> <td>JDBC和Android的轻量级ORM java包</td> </tr> <tr> <td><a href="/misc/goto?guid=4958848077537610631" rel="nofollow,noindex">GreenDAO</a></td> <td>轻松将对象映射到SQLite数据库的ORM解决方案</td> </tr> </tbody> </table> <h2><strong>5.图表处理</strong></h2> <table> <thead> <tr> <th>名称</th> <th>描述</th> </tr> </thead> <tbody> <tr> <td><a href="/misc/goto?guid=4959626605174221111" rel="nofollow,noindex">WilliamChart</a></td> <td>创建图表的Android库</td> </tr> <tr> <td><a href="/misc/goto?guid=4959622833152331860" rel="nofollow,noindex">HelloCharts</a></td> <td>兼容性超高的Android图表库</td> </tr> </tbody> </table> <h2><strong>6.后台处理</strong></h2> <table> <thead> <tr> <th>名称</th> <th>描述</th> </tr> </thead> <tbody> <tr> <td><a href="/misc/goto?guid=4959677129397242089" rel="nofollow,noindex">Android Priority Job Queue</a></td> <td>专门为Android轻松调度任务的工作队列</td> </tr> </tbody> </table> <h2><strong>7.响应式编程</strong></h2> <table> <thead> <tr> <th>名称</th> <th>描述</th> </tr> </thead> <tbody> <tr> <td><a href="/misc/goto?guid=4958873637259306454" rel="nofollow,noindex">RxAndroid</a></td> <td>Android上的响应式扩展,在RxJava基础上添加了Android线程调度</td> </tr> <tr> <td><a href="/misc/goto?guid=4958865750209621132" rel="nofollow,noindex">RxJava</a></td> <td>JVM上的响应式扩展</td> </tr> <tr> <td><a href="/misc/goto?guid=4958969795236376469" rel="nofollow,noindex">RxBinding</a></td> <td>提供用RxJava绑定Android UI的API</td> </tr> </tbody> </table> <h2><strong>8.事件总线</strong></h2> <table> <thead> <tr> <th>名称</th> <th>描述</th> </tr> </thead> <tbody> <tr> <td><a href="/misc/goto?guid=4959716684084241970" rel="nofollow,noindex">EventBus</a></td> <td>优雅地替换Handler</td> </tr> <tr> <td><a href="/misc/goto?guid=4958965423947089796" rel="nofollow,noindex">OTTO</a></td> <td>同样非常好用的总线库</td> </tr> </tbody> </table> <h2><strong>控件库</strong></h2> <h2><strong>1.下拉刷新、下拉加载</strong></h2> <table> <thead> <tr> <th>名称</th> <th>描述</th> <th>展示图</th> </tr> </thead> <tbody> <tr> <td><a href="/misc/goto?guid=4958533801755197808" rel="nofollow,noindex">Android PullToRefresh</a></td> <td>最经典、最多人用的下拉刷新、加载更多。</td> <td> <p><img src="https://simg.open-open.com/show/4db0eca3cee58de57850eb64d5c9cd11.png"></p> </td> </tr> <tr> <td><a href="/misc/goto?guid=4958864078206473805" rel="nofollow,noindex">Android Ultra Pull To Refresh</a></td> <td>非常方便自定义的下拉刷新框架,继承于ViewGroup可以包含任何View,使用起来非常简单,如果想要自定义样式,就像给ListView加一个HeaderView一样简</td> <td> <p><img src="https://simg.open-open.com/show/3e057b1536927f30df3b45ce3d29e164.gif"></p> </td> </tr> <tr> <td><a href="/misc/goto?guid=4958974933498568481" rel="nofollow,noindex">Phoenix</a></td> <td>漂亮的动态刷新库</td> <td> <p><img src="https://simg.open-open.com/show/614dd39dd11646d05a35c8d77fe25956.gif"></p> </td> </tr> </tbody> </table> <h2><strong>2.底部导航栏</strong></h2> <table> <thead> <tr> <th>名称</th> <th>描述</th> <th>展示图</th> </tr> </thead> <tbody> <tr> <td><a href="/misc/goto?guid=4959723176889896042" rel="nofollow,noindex">LuseenBottomNavigation</a></td> <td>很方便的遵循MD设计的底栏</td> <td> <p><img src="https://simg.open-open.com/show/aa352a9b8283698171153c384041a012.gif"></p> </td> </tr> <tr> <td><a href="/misc/goto?guid=4959723176978552837" rel="nofollow,noindex">ahbottomnavigation</a></td> <td>遵循谷歌设计规范的底栏库</td> <td> <p><img src="https://simg.open-open.com/show/eefa600af7a2a221f5a8d30e4065a390.gif"></p> </td> </tr> <tr> <td><a href="/misc/goto?guid=4959722773464527740" rel="nofollow,noindex">BottomBar</a></td> <td>另一个遵循谷歌设计规范的底栏库(PS:之前我使用的时候有点小BUG现在不清楚)</td> <td> <p><img src="https://simg.open-open.com/show/7a7970f9e17f55288711fb7d6febe80e.gif"></p> </td> </tr> </tbody> </table> <h2><strong>3.二维码</strong></h2> <table> <thead> <tr> <th>名称</th> <th>描述</th> <th>展示图</th> </tr> </thead> <tbody> <tr> <td><a href="/misc/goto?guid=4958860114047209235" rel="nofollow,noindex">Zxing</a></td> <td>谷歌开发的二维码处理库,质量没的说!一维码二维码都能扫!</td> <td> <p><img src="https://simg.open-open.com/show/98573e4cefa7b60195c61ba7dd17731e.jpg"></p> </td> </tr> </tbody> </table> <h2><strong>4.侧滑菜单</strong></h2> <table> <thead> <tr> <th>名称</th> <th>描述</th> <th>展示图</th> </tr> </thead> <tbody> <tr> <td><a href="/misc/goto?guid=4959624990208022837" rel="nofollow,noindex">NavigationDrawer</a></td> <td>Material Design的抽屉模板库,快速搭建侧滑菜单。</td> <td> <p><img src="https://simg.open-open.com/show/ef8e1c85f16b0b1148cfb56b746bdba1.png"></p> </td> </tr> <tr> <td><a href="/misc/goto?guid=4958533801538828985" rel="nofollow,noindex">SlidingMenu</a></td> <td>之前也是个很优秀的侧滑库直到谷歌来搅局。。</td> <td> <p><img src="https://simg.open-open.com/show/5e58914e075dc47616e8b62a423d2763.jpg"></p> </td> </tr> <tr> <td><a href="/misc/goto?guid=4958970156919666678" rel="nofollow,noindex">FlowingDrawer</a></td> <td>超帅的侧滑菜单</td> <td> <p><img src="https://simg.open-open.com/show/eb3db1093ac361f0ef0b413d4453cb51.gif"></p> </td> </tr> </tbody> </table> <h2><strong>5.侧滑返回</strong></h2> <table> <thead> <tr> <th>名称</th> <th>描述</th> <th>展示图</th> </tr> </thead> <tbody> <tr> <td><a href="/misc/goto?guid=4958961793271889624" rel="nofollow,noindex">ParallaxSwipeBack</a></td> <td>带视觉差的侧滑返回,类似于新版微信和lofter的侧滑返回效果。引入方便,核心代码只需几十行!</td> <td> <p><img src="https://simg.open-open.com/show/4c2ef38cc20d9d18878f19e91ae3822f.gif"></p> </td> </tr> </tbody> </table> <h2><strong>6.文本输入框</strong></h2> <table> <thead> <tr> <th>名称</th> <th>描述</th> <th>展示图</th> </tr> </thead> <tbody> <tr> <td><a href="/misc/goto?guid=4958988896174301949" rel="nofollow,noindex">MaterialEditText</a></td> <td>方便自定义的EditText控件库</td> <td> <p><img src="https://simg.open-open.com/show/9b3e1b5d2e2a116f80e4d083286f8e28.jpg"></p> </td> </tr> </tbody> </table> <h2><strong>7.侧贴标签</strong></h2> <table> <thead> <tr> <th>名称</th> <th>描述</th> <th>展示图</th> </tr> </thead> <tbody> <tr> <td><a href="/misc/goto?guid=4958865653072877708" rel="nofollow,noindex">labelview</a></td> <td>类似淘宝的侧贴标签库</td> <td> <p><img src="https://simg.open-open.com/show/fd7382f9c70c06fd35feb9c0b9f7584b.jpg"></p> </td> </tr> <tr> <td><a href="/misc/goto?guid=4958975285491037132" rel="nofollow,noindex">FlycoLabelView</a></td> <td>轻量级侧贴标签</td> <td> <p><img src="https://simg.open-open.com/show/2122f78265fe166a64f9f26eebec701f.jpg"></p> </td> </tr> </tbody> </table> <h2><strong>8.侧滑功能项</strong></h2> <table> <thead> <tr> <th>名称</th> <th>描述</th> <th>展示图</th> </tr> </thead> <tbody> <tr> <td><a href="/misc/goto?guid=4958988892883713246" rel="nofollow,noindex">AndroidSwipeLayout</a></td> <td>类似QQ的侧滑删除</td> <td> <p><img src="https://simg.open-open.com/show/9d46e51edbf58603484a58a7a87db671.gif"></p> </td> </tr> </tbody> </table> <h2><strong>9.动画库</strong></h2> <table> <thead> <tr> <th>名称</th> <th>描述</th> <th>展示图</th> </tr> </thead> <tbody> <tr> <td><a href="/misc/goto?guid=4958972599097803565" rel="nofollow,noindex">animate</a></td> <td>几乎涵盖所有MD动画</td> <td> <p><img src="https://simg.open-open.com/show/6a953cd944a0ac105537a2f86d40dd06.gif"></p> </td> </tr> <tr> <td><a href="/misc/goto?guid=4958867433177598880" rel="nofollow,noindex">Material-Animations</a></td> <td>MD动画库</td> <td> <p><img src="https://simg.open-open.com/show/953043508ec0675668ebb5d421b352aa.gif"></p> </td> </tr> <tr> <td><a href="/misc/goto?guid=4958969641620823884" rel="nofollow,noindex">ExplosionField</a></td> <td>爆破效果的删除动画库</td> <td> <p><img src="https://simg.open-open.com/show/87f645359f6e1a628a0ce5bb8930b8ac.gif"></p> </td> </tr> <tr> <td><a href="/misc/goto?guid=4959723177481149266" rel="nofollow,noindex">LoadingDrawable</a></td> <td>小清新的加载动画</td> <td> <p><img src="https://simg.open-open.com/show/d2defb78179368f3f0f16a6aaef03dbc.gif"></p> </td> </tr> </tbody> </table> <h2><strong>10.搜索框</strong></h2> <table> <thead> <tr> <th>名称</th> <th>描述</th> <th>展示图</th> </tr> </thead> <tbody> <tr> <td><a href="/misc/goto?guid=4958973205894805008" rel="nofollow,noindex">floatingsearchview</a></td> <td>自带动画与动态加载数据的搜索框控件</td> <td> <p><img src="https://simg.open-open.com/show/89a7a33c05bbb7650b6c7072989aab1b.gif"></p> </td> </tr> </tbody> </table> <h2><strong>11.快捷选择</strong></h2> <table> <thead> <tr> <th>名称</th> <th>描述</th> <th>展示图</th> </tr> </thead> <tbody> <tr> <td><a href="/misc/goto?guid=4958970156403228728" rel="nofollow,noindex">drag-select-recyclerview</a></td> <td>一直觉得魅族的快捷选择很有用,终于找到一个类似功能的还支持recycleView</td> <td> <p><img src="https://simg.open-open.com/show/aa8e0c144f4bf1496b593f81c8efa91a.gif"></p> </td> </tr> </tbody> </table> <h2><strong>12.引导页</strong></h2> <table> <thead> <tr> <th>名称</th> <th>描述</th> <th>展示图</th> </tr> </thead> <tbody> <tr> <td><a href="/misc/goto?guid=4958987449802624685" rel="nofollow,noindex">material-intro</a></td> <td>MD风格的引导页</td> <td> <p><img src="https://simg.open-open.com/show/aa25928adf0c13ac319d97fc76532217.png"></p> </td> </tr> <tr> <td><a href="/misc/goto?guid=4959718466360253655" rel="nofollow,noindex">SlidingTutorial</a></td> <td>很顺滑的引导页</td> <td> <p><img src="https://simg.open-open.com/show/a412fd4f40bfc318f34e1f5839fe0be8.gif"></p> </td> </tr> <tr> <td><a href="/misc/goto?guid=4958984398054842345" rel="nofollow,noindex">MaterialIntroView</a></td> <td>MD式的高亮引导页</td> <td> <p><img src="https://simg.open-open.com/show/f3e2239438dd4a1a01d007c1eb00dd96.gif"></p> </td> </tr> <tr> <td><a href="/misc/goto?guid=4958975973535449956" rel="nofollow,noindex">HTextView</a></td> <td>其实这是个帅炸的文字展示库,可是我用过做引导页而且逼格不错!</td> <td> <p><img src="https://simg.open-open.com/show/a38186cf4be82e6003014261687f45c2.gif"></p> </td> </tr> </tbody> </table> <h2><strong>13.菜单(高能)</strong></h2> <table> <thead> <tr> <th>名称</th> <th>描述</th> <th>展示图</th> </tr> </thead> <tbody> <tr> <td><a href="/misc/goto?guid=4959723177772955629" rel="nofollow,noindex">android-snake-menu</a></td> <td>类似Tumblr的蛇形菜单</td> <td> <p><img src="https://simg.open-open.com/show/6aa34b3f25b1e9cc3e6c64f6311c2cdd.gif"></p> </td> </tr> <tr> <td><a href="/misc/goto?guid=4958979787996555653" rel="nofollow,noindex">coolMenu</a></td> <td>帅炸的视窗菜单</td> <td> <p><img src="https://simg.open-open.com/show/0e69985317d4384c0164065ac6dc6931.jpg"></p> </td> </tr> <tr> <td><a href="/misc/goto?guid=4959723177883429962" rel="nofollow,noindex">BoomMenu</a></td> <td>爆炸式的弹出菜单</td> <td> <p><img src="https://simg.open-open.com/show/7728341ca623844f32e7f3ec4733e094.gif"></p> </td> </tr> </tbody> </table> <h2><strong>总结</strong></h2> <p>Github上优秀的开源库很多,经常找些优秀的库可以缩短开发时间,多看些开源项目源码也有利于开发与代码规范。</p> <p> </p> <p> </p> <p>来自:http://www.jianshu.com/p/19368c2cdcaf</p> <p> </p>