Search code examples
androidstreamingmedia-playerforeground-service

How to implement streaming media player as foreground service?


Am trying to make an streaming MediaPlayer. There is categories for songs and Each category contains number of songs. I have implemented MediaPlayer in Service. For the communication between Activity and Service i have used messages,intents, and runnable. But my issue is that App not responding smoothly. Swipes and Clicks are very slow. And Checking on RAM usage , app's ram usage going high on playing songs.

Please help me out from this issue,

Thanks and regards,


Solution

  • You can check this question, it has an example to bind service with your activity. Personally I prefer to bind service with activity to be able to control the player, instead of sending intent or message because it takes a slighting more time like 0.5 - 1 second. Also I had a similar question in the past, you can check it, it might help you.