Search code examples
javaandroidandroid-mediaplayer

Obtaining titles from raw folder


Student programmer here so please have patience...

I am simply trying to obtain the file names of .mp3 files in the raw folder (in string form). Does anyone have a quick method of doing this? Cheers!


Solution

  • You can use Apache FileUtils

    For example :

     for (File f: FileUtils.getFile(MAIN_PATH + "pathOfFolder\\").listFiles()) {
    
        System.out.println("File Name: " + f.getName());
    
     }
    

    Hope this helps your out