I just downloaded the last version from github and I fixed it now.
The application ran ok but still I'm not getting the files from android directory.
I'm explaining again what I want to get from the directory of my android phone.
I want to fill a listbox with the name of a mp3 file. ( I did this in windows and it works fine ).
The mp3 file is stored in my phone at user Music Directory.
Now, these are the codes i wrote for this to work :
int getNumRows() {
File folder(File::getSpecialLocation(File::userMusicDirectory));
return folder.getNumberOfChildFiles(File::findFiles, "*.mp3");
}
void paintListBoxItem(int rowNumber, Graphics& a, int width, int height, bool rowIsSelected) {
if (!rowIsSelected) {
a.setColour(Colour(0, 127, 255).brighter(0.3f));
} else if (rowIsSelected) {
a.fillAll(Colour(0, 127, 255).brighter(0.08f)); a.setColour(Colours::white);
}
a.setFont(height * 0.9f);
File folder(File::getSpecialLocation(File::userMusicDirectory));
folder.findChildFiles(files, File::findFiles, true, "*.mp3");
a.drawText(" " + String(files.getReference(rowNumber).getFileName()), 5, 0, width, height, Justification::centredLeft, true);
}
The only problem is with the location of the directory.
When I run the project the application opens but the list is empty.
In the list should appear the mp3 file name.
Maybe I should set the directory like this : File folder("/storage/emulated/0/Music/");
I'd appreciate the help.
Thanks. ;)