Right way to access the internal storage android


#1

HI!
I’m trying to read the files in the internal directory of my android device. First i try to get the path:

ofLog()<<ofToDataPath<< endl;

“/storage/emulated/0/Android/data/cc.openframeworks.androidOpenCVExample/files”

I suppose that i have to go to files directory i try to read the files and get this in the console

  dir.listDir("files");
  for(int i = 0; i < (int)dir.size(); i++) {
         string fileName = dir.getName(i);
       }
     ofLogNotice(fileName);

05-23 19:15:23.600 21618-21634/cc.openframeworks.androidOpenCVExample E/ofDirectory: listDir:() source directory does not exist: ““storage/emulated/0/Android/data/cc.openframeworks.androidOpenCVExample/files/files/””

which is the right way to access the internal storage in android device?


#2

You access using this

dir.listDir("");