任何最好的第三方工具来缓存图像中的Andr​​oid? [英] Any best third party tool to cache image in Android?

查看:126
本文介绍了任何最好的第三方工具来缓存图像中的Andr​​oid?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

请问我们有什么方法/班缓存像iOS的Afnetworking,如果回答是或者不是好心建议我这个类使用?

Does we have any method/Class for caching like in iOS Afnetworking., if yes or not kindly suggest me this class to use?

推荐答案

有几种解决方案,你可以使用,这取决于你所需要的。 如果你想在缓存L1(RAM)的图像,你可以使用软件开发工具包LRUCache(或从支持V4),并轻松地将其设置为BitmapLruCache。如果你需要缓存的L1和L2(磁盘)的图像,你可以用在GitHub上2级LRU缓存解决方案(如乌蛮/ TwoLevelLruCache和这样的)。

There are several solutions that you can use, it depends on what you need. If you want to cache images on L1 (ram) you can use the SDKs LRUCache (or from the support v4) and easily set it up as BitmapLruCache. If you need to cache images on both L1 and L2 (disk) you can use "2 level LRU cache" solutions on GitHub (such as wuman/TwoLevelLruCache and such).

如果你需要缓存作为图像加载库的一部分,你可以检查出以下之一:(它们都有L1 / L2缓存)

If you need caching as part of an image loading library you can check out one of the following: (they all have L1/L2 caches)

**毕加索(由广场): 这是简单和易于使用。 http://square.github.io/picasso/

** Picasso (by Square): It's simple and and easy to use. http://square.github.io/picasso/

**滑翔 具有相同的API毕加索,但包含了一些增强功能(如动画GIF支持) https://github.com/bumptech/glide

** Glide Has the same API as Picasso but contains some enhancements (such as animated GIF support) https://github.com/bumptech/glide

**壁画(被Facebook): 这件事情是一个坏屁股的机器,pretty的简单易用,但确实包含即时通讯pressive的功能集。不会使用它的简单。 <一href="https://$c$c.facebook.com/posts/366199913563917/introducing-fresco-a-new-image-library-for-android/" rel="nofollow">https://$c$c.facebook.com/posts/366199913563917/introducing-fresco-a-new-image-library-for-android/

** Fresco (by Facebook): This thing is a bad ass machine, pretty simple to use but contains really impressive set of capabilities. Wouldn't use it for a simple. https://code.facebook.com/posts/366199913563917/introducing-fresco-a-new-image-library-for-android/

(github上: https://github.com/facebook/fresco

您还可以看到一些比较这里:

you can also see some comparisons here:

<一个href="http://stackoverflow.com/questions/29363321/picasso-v-s-imageloader-v-s-fresco-vs-glide">Picasso V / S ImageLoader的V / S壁画VS滑翔   <一href="http://vardhan-justlikethat.blogspot.co.il/2014/09/android-image-loading-libraries-picasso.html" rel="nofollow">http://vardhan-justlikethat.blogspot.co.il/2014/09/android-image-loading-libraries-picasso.html

干杯!

这篇关于任何最好的第三方工具来缓存图像中的Andr​​oid?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆