Islamic-Streamer-Android icon indicating copy to clipboard operation
Islamic-Streamer-Android copied to clipboard

audio stream needs to be in a background service

Open wnafee opened this issue 13 years ago • 4 comments

Ideally the audio stream needs to be in a background service to ensure that the OS does not kill it if your activity gets killed by the system.

wnafee avatar Jun 21 '11 13:06 wnafee

i meant to do it like this so it can be killed by the system imagine playing سورة البقره and then the system hand and the app had to be killed this means that the surah will play until it finishes i think this is better and even when press on the back button any surah will continue playing i think this is acceptable

moamenam avatar Jun 21 '11 13:06 moamenam

wael, what if it is implemented as a background service then the app got killed then the user launched it again, can it still communicate with the service to stop it if the user wants to stop? Isn't this a new sandboxed process different from that of the service? Do you accept moamen's scenario to close this issue?

hammady avatar Jun 21 '11 13:06 hammady

salamo alaykom hosam, If your service is owned by your application, you can resync with the service and come back again properly even if your activity got killed. This should be no problem. So this means that you can detect that you're still playing something and stop it if needed.

To see an example of this, look at the quran_android code for downloading in the background to see what i mean.

wnafee avatar Jun 21 '11 14:06 wnafee

wael, can you please provide a sample for a service owned by the application, i'm work on this issue currently

moamenam avatar Jun 27 '11 11:06 moamenam