I am working in a Streaming App (for a Webradio), and i am having a problem with the Exo Player: When we block the phone, after some minutes, the sound stop, and it ocour even some notification of other app arrives or i press the button to check the smartphone.
There are many misconceptions about the term “background”. Background means only that the app is not not visible (eg after pressing the home button or the app is in sleep mode, black screen), but is not closed.
So if the screen goes into sleep mode or you press the home button, the sound (ExoPlayer) should continue to play …
Background task means that the app can execute somthing even when it is closed, this is not possible with Kodular and the other builders (Ai2, Thunkable etc.). So when the app is closed the sound will stop.
So if the sound stops even though the app was not closed, you’re making a mistake somewhere.
I confirm closing the application after a few minutes.
Tested on EMUI 8, 9, 9.1, 10. (Android 8, 9, 10)
Setting “no saving battery” give nothing.
All other settings do nothing.
I had to add the screen turned on permanently to use the radio.
Unfortunately, Kodular has it and nothing can be done.
Does this only happen in sleep mode or even when the app is in the background (e.g. the home button was pressed)? How long does it take after the device has switched to sleep mode before the sound stops?
This happens regardless of the screen being turned off. Just use another application when you have not turned off ours. It will also be turned off after a few minutes.
I never counted that time. It takes from a few to several minutes.