Hi, im trying to make countdown clock run even after the phone goes to sleep mode by this method but its not working (trying to play a sound in a loop). The countdown stops.
I'll be happy for help.
Hi, im trying to make countdown clock run even after the phone goes to sleep mode by this method but its not working (trying to play a sound in a loop). The countdown stops.
See the example here
Taifun
You must use a Foreground service on devices with Android 6+ (to prevent Doze mode). See e.g. here: Ullis Roboter Seite/AI2 Keep Alive
The Android Player component (MediaPlayer) cannot loop sounds seamlessly (without small gaps). You must use the TaifunPlayer
or another appropriate Player extension.
Thanks ill try it
... and you must use .ogg
or .wav
audio format for gapless looping.
And then its enough to put a block for running a player in a loop or do i need other things like using foreground service to solve the problem?
→ post #3
.