Glide. Cache To External Storage (SD Card)
I use Glide for loading Images in my android application. After 3.5 update, developers provided GlideModule interface. According to this article (Disk Cache) I can set cache direct
Solution 1:
To setup GlideBuilder
with value of setDiskCache
You can set your ExternalStorageDirectory as a cache directory.
if (!Glide.isSetup()) {
GlideBuilder gb = new GlideBuilder(this);
DiskCache dlw = DiskLruCacheWrapper.get(new File(Environment.getExternalStorageDirectory().getAbsolutePath() + "/YourCacheDirectory/"), 250 * 1024 * 1024);
gb.setDiskCache(dlw);
Glide.setup(gb);
}
Check Can't set GlideBuilder
Hope its help you.
Post a Comment for "Glide. Cache To External Storage (SD Card)"