So I am going to edit the manifest file in Android Studio or is there a easier quicker way?
You can use al2alive extension by ullis reboter ,
https://ullisroboterseite.de/android-AI2-KeepAlive-en.html
Service manifest by manifest generator by atom developer
com.atomdeveloper.ManifestCode.aix (6.0 KB)
And its perfectly works in kodular too ,
test aia : MusicPlayer.aia (4.5 MB)
Not for a live stream just looping to a static sound .mp3
Yes, sorry
And obviously this does not have to be declared in the Manifest, since it is true
by default:
service android:enabled="true"
Hmm @bodymindpower did you try to run app in background if yes then pls tell me also. I can added code to manifest using atom Developer extension and how did you run the code to perform background services ???
This is about a Foreground
service (and not a Background
service) to prevent Doze
mode (and thus the stuttering / stopping of the sound in idle (sleep) mode).
Thanks its work. But if i press backpress it will close app and stop the music.
Yes, of course, because the app is closed then and as I said:
thank you for clearing that up, much appreciated and embraced
This one work very well on new Android versions when Doze mode exist(API >= 23), except when call Start function block got error
on my phone Blackberry ZTE Android 6.0.1 (API 23).
It’s look like the code do not check if some fonctions are supported…
I used another app to test if the phone support Doze mode and i discover it does not support it.
So it’s mean i can not based on API version to check if the phone support it.
Do someone know how to check if Doze mode supported?
And then how to avoid sleep on old devices who do not support Doze mode?
I Set “Keep WiFi on during sleep” to “Always” and disable Battery Optimisation manually, but the internet still sleep when playing audio with Exo player.
But this happen only if playing playlist with multiple short audio, when playing a long one this do not happen.
Btw, the presence of Doze
does NOT automatically imply that WLAN etc. are throttled / switched off in the background (idle mode); it seems to be manufacturer-dependent in this respect (Samsung is apparently primarily affected).
You can actually change the UI.