android 常用库笔记

一、网络通信

  •    andriod-async-http  :自动对gzip解码,实现快速请求响应,多种形式响应解析有原生对字节流、String、JSON对象。

                                              缺点 android 的高版本底层库支持

  •    okHttp     低网络尤佳,Http初始化握手失败后,会降级使用TSL1.0尝试初始化连接。依赖okio和okhttp两个Jar包。

                         是众多使  用推荐优先使用的 etrofit与picasso一样都是在okhttp基础之上做的封装

  •    Volley      引用 compile 'com.mcxiaoke.volley:library:1.0.19'
  •    Retorfit    要求服务器API借口遵循REST规范,使用GSON作为JSON解析器

    andriod-async-http  Volley Retorfit 是基于HttpURLConnection、Apache HttpClient和OkHttp封装的网络请求

    https://www.jianshu.com/p/bf2f2a7aac9a

    https://blog.csdn.net/LVXIANGAN/article/details/88412867

二、图片缓存和显示

  •        BitmapFun   
  •        Picasso
  •        Glide
  •        Fresco
  •        Android-Universal-Image-Loader
  •       SmartImageView

对于严重依赖图片缓存的APP来说优先选择Fresco

一般来说推荐使用Glide:

     implementation 'com.github.bumptech.glide:glide:4.4.0'

    annotationProcessor 'com.github.bumptech.glide:compiler:4.4.0'

    implementation 'jp.wasabeef:glide-transformations:2.0.2'

 <uses-permission android:name="android.permission.INTERNET" />
Glide.with(this).load(url).into(imageView);

https://www.jianshu.com/p/791ee473a89b

https://blog.csdn.net/xxdw1992/article/details/93624487

三、日志

    timber+Logger+LogUtils

四、JSON解析

  •  gson Google出品
  •  jackson
  •  Fastjson  阿里出品 

       https://mvnrepository.com/artifact/com.alibaba/fastjson

      如果本地后台 maven加入过,注意版本一致,否则会报错

  •  LoganSquare 

五、数据操作

  •   ActiveAndroid
  •   ormlite
  •   greenDAO
  •    Realm

https://www.2cto.com/kf/201802/718495.html

发布了255 篇原创文章 · 获赞 39 · 访问量 35万+

猜你喜欢

转载自blog.csdn.net/kangguang/article/details/103997979
今日推荐