android - How to retrieve images from cache memory in picasso? -
i using picasso library loading images .in default picasso, uses internal cache memory loading images.but per app configuration ,i have use external cache memory(cache on disk). used code cache on disk
file httpcachedir = new file(getapplicationcontext().getexternalcachedir(),"http"); long httpcachesize = 10 * 1024 * 1024; // 10 mib httpresponsecache.install(httpcachedir, httpcachesize);}
picasso flexible. caches images in external sd card..
the caches stored in sdcard/android/data/packagename/cache/http caches stored in ".1" ,".0". formats opened them , changes ".1" ".jpg".it gives exact images need. how in programatically? picasso caches memory in app loading image imageview.but have save them sdcard directly images/set bitmap wallpaper in offline mode?
you can supply own cache
implementation when building picasso
instance. way can provide methods can call retrieve bitmaps directly memory cache. use picasso.builder
provide own implementation it. when use with()
using static singleton internal instance thats setup of default values (most apps need default values anyway.)
keep reference of cache
implementation around , directly interact it. picasso meant handle loading/decoding , caching there no reason cant build around it.
if referring disk cache, no picasso not support @ moment. design because disk layer cache done http layer , makes no distinction it.
you however, change path of disk cache. if using okhttpdownloader supply different file when construct downloader. urlconnectiondownloader extend , override load()
method.
Comments
Post a Comment