Search code examples
javaandroidprocessing

Loading image in processing android


I am having an issue when running the processing sketch, listed below, on my android phone and get the following error:

java.io.FileNotFoundException: /data/user/0/processing.test.sketch_230817a/files/Toyokawa-city.jpg: open failed: ENOENT (No such file or directory)

PImage photo;

void setup() {
  size(400, 400);
  photo = loadImage("Toyokawa-city.jpg");
}

void draw() {
  image(photo, 0, 0);
}

So the question is how can I load the image in processing android?


Solution

  • Add a file in your project directory called data so it should look like this project_folder\data\Toyokawa-city.jpg