# \[SOLVED\] Show image stored in SDCARD (sdk 26)

**URL:** <https://discourse.processing.org/t/solved-show-image-stored-in-sdcard-sdk-26/4397>\
**Category:** Processing for Android\
**Created:** [October 12, 2018, 3:42pm UTC](https://discourse.processing.org/t/solved-show-image-stored-in-sdcard-sdk-26/4397 "2018-10-12T15:42:38Z")\
**Posts on this page:** 1\
**Showing post:** 11

<div class="post-metadata">

**Author:** ![julienrat](https://avatars.discourse-cdn.com/v4/letter/j/7ea924/32.png) [@julienrat](https://discourse.processing.org/u/julienrat)\
**Post date:** [October 13, 2018, 10:45am UTC](https://discourse.processing.org/t/solved-show-image-stored-in-sdcard-sdk-26/4397/11 "2018-10-13T10:45:50Z")

</div>

SOLVED ! Thx a lot !  
There is a builtin function [https://android.processing.org/reference/permissions/request.html](https://android.processing.org/reference/permissions/request.html)

Here is my code

```auto
import android.os.Environment;
PImage img;
File myFile = android.os.Environment.getExternalStoragePublicDirectory(android.os.Environment.DIRECTORY_DCIM);
void setup() {
  requestPermission("android.permission.READ_EXTERNAL_STORAGE", "initRead");
  requestPermission("android.permission.WRITE_EXTERNAL_STORAGE", "initWrite");
}
void draw() {

}

void initRead(boolean granted) {
  if (granted) {   
    println("init read sdcard OK");
    String myPath= myFile.toString();
    img = loadImage(myPath+"/cat.jpg");/// if needed add subfolders!
    image(img,0,0);
    // ...
  } else {
    println("Read SDcard is not available");
    // ...
  }
}
void initWrite(boolean granted) {
  if (granted) {   
    println("init write sdcard OK");
    // ...
  } else {
    println("Write SDcard is not available");
    // ...
  }
}

```

---

_[View the full topic](https://discourse.processing.org/t/solved-show-image-stored-in-sdcard-sdk-26/4397)._
