I want to build a music player that "plays" all mp3 files from a folder.
As all music player user can play, pause, next music etc.
I'm planning to build using:
activity - controls play, pause, next music buttons.
service 1 - It controls the current file running and manage next file and handle activity actions
service 2 - It plays the current file.
Is that a good approach?
Is anyone has some experience on that?
You can use a single service for that, though two services are also fine. Make sure to call Service.StartForeground to prevent Android from killing the process when the activity is not visible.
Thank you.
The main problem I see with only one service is:
If I make a function with "for each file in folder plays it" how can I control it when the user press Pause? How can I also pause the "For construction"?