List all files in Data directory on android
in
Android Processing
•
1 year ago
I'm trying to list all files in the data directory using the code below, but it would not work on android (works fine in Standard mode).
I think files created in a processing sketch are saved to "/data/data/changethispackage.beforesubmitting.tothemarket.egdirectorylist0__1/files", but I cannot find the files I put in the sketch data folder anywhere in the android device. I'm getting a bit desperate and wonder if I should just start using android ide :(
Any hint please?
// This function returns all the files in a directory as an array of Strings
String[] listFileNames(String dir) {
File file = new File(dir);
if (file.isDirectory()) {
String names[] = file.list();
return names;
}
else {
// If it's not a directory
return null;
}
}
1