-2

I am trying to build a music player and while researching the behavior of other apps I have realized that some apps store the now playing list and the song id, so that same state is available when the app is started afresh.

1.) So how to implement this? Which technique will be faster?

Saving song id is simpler by using shared preferences but what about whole list of songs and other data associated with them ( like duration , title...). How to store them.

2.) Also some song that was stored gets deleted, so how to manager that?

I have already tried searching and came up with this but to no avail:

How to save "now playing" list of Music Player App in Android?

Community
  • 1
  • 1
Rahul Verma
  • 25
  • 1
  • 8
  • This question is too broad. There could be a lot of possible ways to do this. – JLT May 04 '16 at 16:39
  • Can you list the possible ways? I have two qs. you can at least answer one of them if you know? Thanks. And I don't know why the -1 because as I have mentioned that I have searched for ways and also attached the link. – Rahul Verma May 04 '16 at 17:16
  • @JLT can you answer the qs please or atleast mention the links. I have been stuck on this qs for a while now. – Rahul Verma May 04 '16 at 17:38
  • Hey guys help. got no solution till now. – Rahul Verma May 10 '16 at 10:14

1 Answers1

0

Try using this method it is used to store array list in shared preferences. Hoping that your now playing list is a array list.

Save ArrayList to SharedPreferences

Community
  • 1
  • 1
uday
  • 51
  • 1
  • 8
  • I have array list of song class objects which holds song's id, title and everything. How to integrate it with that? – Rahul Verma May 04 '16 at 17:55