Android Cursorloader to playlist

65 views Asked by At

I have music player app, I am querying Mediastore database using content provider, when a user clicks on song entry, I create an object from cursor of that song and pass it to service which controls the playback

Now if I want to queue remaining songs I have to create object of all the entries from database and pass it to service, but what if I have N number of songs.

So my question is, whether the above approach is correct? and what is the best to way for such scenario?

1

There are 1 answers

1
Ranjan On

There is one more approach,

Make a database and put all songs with an id(like 0,1,2),path,AlbumName..,etc, with the help of Mediastore. Then use that database to fetch data. When user click a song just pass the id, and in the screen where you want to play the song, use the id to get details from Database and to play the song.