0

Hi im trying to load image from the native OS gallery using UIL and the following uri:

/storage/emulated/0/DCIM/Camera/IMG_20140713_103602.jpg

And im getting:

UIL doesn't support scheme(protocol) by default [/storage/emulated/0/DCIM/Camera/IMG_20140713_103602.jpg]. You should implement this support yourself (BaseImageDownloader.getStreamFromOtherSource(...))
    java.lang.UnsupportedOperationException: UIL doesn't support scheme(protocol) by default [/storage/emulated/0/DCIM/Camera/IMG_20140713_103602.jpg]. You should implement this support yourself (BaseImageDownloader.getStreamFromOtherSource(...))

Any suggestion how can i load such an image?

Giru Bhai
  • 14,370
  • 5
  • 46
  • 74
Evgeni Roitburg
  • 1,958
  • 21
  • 33
  • See it here : [Android - Better Approach in Loading SD CARD Images](http://stackoverflow.com/questions/17420664/android-better-approach-in-loading-sd-card-images) – Anderson K Jul 20 '14 at 15:04

2 Answers2

4

In UIL if you are loading image from SDCARD you should use prefix file:/// as

  String imageUri = "file:///mnt/sdcard/image.png"; // from SD card

i.e.

 "file:///"+Environment.getExternalStorageDirectory().toString()
                + File.separator + "image.png";

So use image path as

file:///storage/emulated/0/DCIM/Camera/IMG_20140713_103602.jpg
Giru Bhai
  • 14,370
  • 5
  • 46
  • 74
  • 1
    Already tried it, getting: Unable to decode stream: java.io.FileNotFoundException: /file:/storage/emulated/0/DCIM/Camera/IMG_20140713_103602.jpg: open failed: ENOENT (No such file or directory) 07-21 09:55:15.850 22038-22662/com.autodesk.autocad360.cad.staging D/Sean9﹕ getCurrentHub, mCurrentHub null? false – Evgeni Roitburg Jul 21 '14 at 06:55
  • @EvgeniRoitburg Did you add permission " " – Giru Bhai Jul 21 '14 at 06:59
  • @EvgeniRoitburg try to append "file:///" not "file:/" – Giru Bhai Jul 21 '14 at 07:04
  • Im sending "file:///+ path" the i assume it changed somehow when printed to logs – Evgeni Roitburg Jul 21 '14 at 07:08
  • @EvgeniRoitburg try to send full path like "file:///storage/emulated/0/DCIM/Camera/IMG_20140713_103602.jpg" – Giru Bhai Jul 21 '14 at 07:11
-1

Try the below format,

String imageUri = "file:///mnt/sdcard/image.png"; // from SD card
intrepidkarthi
  • 3,104
  • 8
  • 42
  • 75