在Android的开发过程中,每个开发者或多或少的都使用过第三方的开源库,使用第三方的开源库可以给开发者节省大量的精力和时间,进而更好的关注应用本身的业务逻辑
下面列出一些开发者们非常常用的开源库。
Fresco
Fresco是非常强大的显示图像的开源库,它能够很好的处理图像的加载和显示。能够加载网络、本地数据库、本地资源中的图像,在图像加载出来之前,还能够预先设置一个预设的图像占位符,有二级缓存(内存和硬盘缓存)
dependencies {
// your app's other dependencies
compile 'com.facebook.fresco:fresco:1.0.1'
}
另外Fresco还提供了一些其他的开源库支持 Gif,WebP等
dependencies {
// If your app supports Android versions before Ice Cream Sandwich (API level 14)
compile 'com.facebook.fresco:animated-base-support:1.0.1'
// For animated GIF support
compile 'com.facebook.fresco:animated-gif:1.0.1'
// For WebP support, including animated WebP
compile 'com.facebook.fresco:animated-webp:1.0.1'
compile 'com.facebook.fresco:webpsupport:1.0.1'
// For WebP support, without animations
compile 'com.facebook.fresco:webpsupport:1.0.1'
// Provide the Android support library (you might already have this or a similar dependency)
compile 'com.android.support:support-core-utils:24.2.1'
}
Glide
Glide是一个快速高效的多媒体管理和图片加载框架,封装了多媒体的解码、内存和硬盘缓存,接口友好
dependencies {
compile 'com.github.bumptech.glide:glide:3.7.0'
compile 'com.android.support:support-v4:19.1.0'
}
OkHttp
OkHttp是一个为Android提供 HTTP+HTTP/2 的客户端,很好的封装了对网络的请求连接
dependencies {
compile 'com.squareup.okhttp3:okhttp:3.6.0'
}
FastAndroidNetworking
FastAndroidNetworking是基于 OkHttp的一个网络引擎
dependencies {
compile 'com.amitshekhar.android:android-networking:0.4.0'
}
</