| Start |
|---|
| Fetch Audio/MP3 files from specific folder of device or fetch all files First, add the following permissions to the manifest of your project in order to enable device storage access: Then, create the file AudioModel.class and put the following model class into it in order to allow getting and setting list items: Next, use the following method to read all MP3 files from a folder of your device or to read all files of your device: The code above will return a list of all MP3 files with the music's name, path, artist, and album. For more details please refer to the Media.Store.Audio (opens new window) documentation. In order to read files of a specific folder, use the following query (you need to replace the folder name): If you want to retrieve all files from your device, then use the following query: Note: Don't forget to enable storage access permissions. Now, all you have to do is to call the method above in order to get the MP3 files: Example with Activity |
Read Article
https://develop.horje.com/learn/1434/reference