I could not find a good application for streaming MP3 files from a URL that can run in the background that meets my requirements, so I decided to write it myself. It turns out it's incredibly easy to transfer MP3s with native MediaPlayer if you use Froyo or better, and I do.
But my problem is that I switch applications and try to save the stream (some of them last 2-4 hours) and play a game or something while I listen to it, sometimes it just dies. I am not sure what the problem is, I assume that the Android system decided that it was normal to kill this process ... but it is not.
So what can I do to kill other processes if I need resources instead of my streaming mp3 application?
What I tried:
android.os.Process.setThreadPriority(android.os.Process.THREAD_PRIORITY_AUDIO);
But this is not good.
source
share