I use Android Universal Image Loading in my android app to load images from the internet and it work just perfect, no outOfMemory errors.
but I tried to use it with local already existing images in my device (cache directory e.g /data/data/package-name/cache/...) but without success I did use file:// plus the link of the image but it seem that I have something going wrong as it sometimes load the images and often doesn't.
I tried to create my own local ImageDownloader
by extending the ImageDownloader
but didn't work either.
to be clear : it's not a permission problem, it's not a path problem!, and the images physically exist in the cache directory.
here's the error i have in the logcat :
05-13 11:41:10.605: W/System.err(28789): java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076)
05-13 11:41:10.605: W/System.err(28789): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)
05-13 11:41:10.613: W/System.err(28789): at java.lang.Thread.run(Thread.java:856)
05-13 11:41:10.613: W/System.err(28789): Caused by: libcore.io.ErrnoException: open failed: ENOENT (No such file or directory)
05-13 11:41:10.613: W/System.err(28789): at libcore.io.Posix.open(Native Method)
05-13 11:41:10.613: W/System.err(28789): at libcore.io.BlockGuardOs.open(BlockGuardOs.java:110)
05-13 11:41:10.613: W/System.err(28789): at libcore.io.IoBridge.open(IoBridge.java:400)
05-13 11:41:10.613: W/System.err(28789): ... 10 more
05-13 11:41:10.613: W/System.err(28789): java.io.FileNotFoundException: /file:/storage/sdcard0/Android/data/com.paperpad.grainedor.appservices/cache/-977741495: open failed: ENOENT (No such file or directory)
05-13 11:41:10.621: W/System.err(28789): at libcore.io.IoBridge.open(IoBridge.java:416)
05-13 11:41:10.621: W/System.err(28789): at java.io.FileInputStream.<init>(FileInputStream.java:78)
05-13 11:41:10.621: W/System.err(28789): at com.paperpad.grainedor.appservices.activities.LocalImageDownloader.getStream(LocalImageDownloader.java:28)
05-13 11:41:10.621: W/System.err(28789): at com.nostra13.universalimageloader.core.decode.BaseImageDecoder.getImageStream(BaseImageDecoder.java:84)
05-13 11:41:10.621: W/System.err(28789): at com.nostra13.universalimageloader.core.decode.BaseImageDecoder.decode(BaseImageDecoder.java:73)
05-13 11:41:10.621: W/System.err(28789): at com.nostra13.universalimageloader.core.LoadAndDisplayImageTask.decodeImage(LoadAndDisplayImageTask.java:290)
05-13 11:41:10.629: W/System.err(28789): at com.nostra13.universalimageloader.core.LoadAndDisplayImageTask.tryLoadBitmap(LoadAndDisplayImageTask.java:250)
05-13 11:41:10.629: W/System.err(28789): at com.nostra13.universalimageloader.core.LoadAndDisplayImageTask.run(LoadAndDisplayImageTask.java:131)
05-13 11:41:10.629: W/System.err(28789): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076)
05-13 11:41:10.629: W/System.err(28789): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)
05-13 11:41:10.629: W/System.err(28789): at java.lang.Thread.run(Thread.java:856)
05-13 11:41:10.629: W/System.err(28789): Caused by: libcore.io.ErrnoException: open failed: ENOENT (No such file or directory)
05-13 11:41:10.629: W/System.err(28789): at libcore.io.Posix.open(Native Method)
05-13 11:41:10.629: W/System.err(28789): at libcore.io.BlockGuardOs.open(BlockGuardOs.java:110)
05-13 11:41:10.629: W/System.err(28789): at libcore.io.IoBridge.open(IoBridge.java:400)
05-13 11:41:10.629: W/System.err(28789): ... 10 more
05-13 11:41:10.629: E/ImageLoader(28789): Image can't be decoded [/data/data/com.paperpad.grainedor.appservices/cache/medias/6/optimized/Sales_individuels_2.jpg_1280x752]
a remark on this is the added /storage/sdcard0/Android/
coming from nowhere in my code!