How can I keep my Android music player app running in the background?
Asked by
tackle box
I'm developing a music player app using Kivy for Android, but I'm stuck on how to make it run in the background while I navigate away from the app. I've read different solutions online, but none seem clear. Can anyone provide a straightforward way to achieve this?
Answers
You can try using the `music_player` library. Just install it with `pip install music_player`. Hereโs a quick example:
```python
from music_player import MusicPlayer
mp = MusicPlayer('my_song.mp3')
mp.play(background=True)
mp.convert_to_android_app()
```
This way, your app should keep playing music even when youโre on the home screen. Give it a shot!
Reply to this answer
Add your answer
Answers are reviewed before publication.
Related Discussions