I have had an Android music app in the play store since May of 2016. Currently I ask the user to specify a folder that has all of their music.
I use the following code to filter their folder for music files:
private boolean isAudioFile(String songTitleLowerCase) {
return songTitleLowerCase.endsWith(".mp3") || songTitleLowerCase.endsWith(".wma") || songTitleLowerCase.endsWith(".wav") || songTitleLowerCase.endsWith(".m4a") || songTitleLowerCase.endsWith("" +
".flac");
}
I have additional code that searches through all the subfolders as well.
This works OK, but has some limitations:
Most users are likely having trouble locating the folder where their music is stored. I have some hints in the app as to common locations for where phones keep their music folders, but between all the phone models, and all the versions of Android, their are quite a few possibilities.
If the user has two or more folders with music, than they either have to consolidate their music, or only have access to part of their music collection with my app. I have not yet implemented code for multiple music folder selection.
I think that most apps automatically find all the music files on the device, and I would like to do this. Previously I implemented this feature, and the problem was that I ended up with all the sound files (i.e from Google Maps), as well as podcasts, and audiobooks mixed in.
So how can I exclude sound clips, podcasts, and audiobooks? Do I just do that by the extensions I choose to include in the code snipped above? I really am not sure what file formats are important to music listeners these days, and which file formats are just for sounds and podcasts, or if there is an overlap in uses. I.E. Are .wav files used for music files or only sound clips?
Thanks for your patience and understanding with my questions. I really appreciate your feedback, as it will help make my app tremendously more user friendly once it can automatically find all the music accurately.