I've been working on media player and I have most of it down. Maybe
I've gone about getting my data the wrong way (would love it if I
could tap into the MediaStore), but I have the files and can play
them. I just can't figure out how to grab the metadata / IDV3 tag
info from it. I don't think I want to use the media scanner becuase
I'm not adding new files.
To get my song list:
public void updateSongList() {
File home = new File(MEDIA_PATH);
if (home.listFiles( new Mp3Filter()).length > 0) {
for (File file : home.listFiles( new Mp3Filter())) {
songs.add(file.getName());
}
}
songsize = songs.size();
position = rand.nextInt(songsize);
playSong(position);
}
To play my songs:
MediaPlayer mp = new MediaPlayer();
mp.reset();
String file = songs.get(song);
mp.setDataSource(MEDIA_PATH + file);
mp.prepare();
Is there any way to query the MediaStore given only a file. Did I
miss a better way to grab all the music files? Thanks.
Rob
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~----------~----~----~----~------~----~------~--~---