4

The caching of my Universal ImageLoader seems not working. I'm wondering where the folder of the cache is. I found there is a folder in my sdcard:

data->data->id of my app->cache->uil-images

But it's empty. Here is my code:

        DisplayImageOptions displayOptions = new DisplayImageOptions.Builder()
                .cacheOnDisc(true)
                .cacheInMemory(false)
                .showStubImage(R.drawable.img_placeholder)
                .showImageForEmptyUri(R.drawable.img_placeholder)
                .showImageOnFail(R.drawable.img_placeholder)
                .bitmapConfig(Bitmap.Config.RGB_565)
                .displayer(new FadeInBitmapDisplayer(500))
                .build();

        ImageLoader imageLoader = ImageLoader.getInstance();
        imageLoader.init(ImageLoaderConfiguration.createDefault(this.context));
        imageLoader.displayImage(imgUrl, imageView, displayOptions);

No matter I set the cacheInMemory to false or true, the result is the same. Can somebody explain what could be wrong with it? Thanks.

By the way, I'm using universal imageloader 1.8.6

Bagusflyer
  • 12,675
  • 21
  • 96
  • 179
  • if you mentioned really your config then "data->data->id of my app->cache->uil-images" is not the right path for images. Default path is "Android/data/{package}/cache" on SD card if you have appropriate permission. Or "data/data/{package}/cache" on devise otherwise. – nostra13 Feb 27 '14 at 19:27
  • Unfortunately there is no any files in these folder you mentioned. So the cache doesn't working for ImageLoader? (By the way, I upgrade my image loader to 1.9.1) – Bagusflyer Feb 28 '14 at 08:35

1 Answers1

2

According to the source code file library/src/main/java/com/nostra13/universalimageloader/utils/StorageUtils.java, cache directory will be created on :

  • SD card, in preference, if card is mounted and app has appropriate permission, at this location /Android/data/[app_package_name]/cache/
  • device's file system /data/data/[app_package_name]/cache/.

This response need to completed because incomplete.

Stéphane B.
  • 3,260
  • 2
  • 30
  • 35