Islamic-Streamer-Android
Islamic-Streamer-Android copied to clipboard
audio stream needs to be in a background service
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.
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
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?
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.
wael, can you please provide a sample for a service owned by the application, i'm work on this issue currently