I have an integrated music player app, this player plays music in a service ...
Now my app is a sports app, so the user listens to music and occasionally, timer incidents happen and alarm plays sound. I want to use the service to run these sounds because I want to stop normal music, play alarm and resume music.
My problem is, sometimes (not very often), there is a long delay ... in some seconds ...
How can I do this?
BTW., I have implemented a do-not-disturb mode, so I use 'audio focus' if this mode is enabled. I have to manually stop the player for internal alarm and start over again ...
You can start service
on the boot, and then bind it whenever you need it. Check the docs to know how it works.
Comments
Post a Comment