Radio app stops when running in background


#1

I have build this app for our radiostation with a audio stream button using audio player. It works fine for about 15 min running in the background and screen turned off and then the stream stops. You then have to maximize the app and press stop and play again and it runs for about 15 more minutes. Other radio apps work fine on my phone? Please help someone.

Jess Pedersen


#2

I had a similar issue and was able to resolve it by turning off Battery Optimization:


How to block energy saver
#4

I see what you mean. But it’s only in my app. Not in any other radio apps I have on my phone. And I cant say when releasing the app that you have to turn off battery optimization for it to work :grin:


#5

I’ve done a little more research.

It appears that this would only potentially affect Android OS 6.0 Marshmallow API23 and newer devices.

Prior to the update to SDK26, changing this setting programmatically wasn’t possible.
AI/AB used SDK22 and these settings came out in SDK23.

I will let the developers know and hopefully they can come up with a fix.


#6

Ok thank you very much :slight_smile: Fingers crossed


#7

same problem , i wish it will be fix soon


#8

It’s a very important problem I think. It makes the feature and in the end the app useless


#10

My stream runs for about 10 minutes and then stops.


#11

I also have almost same problem.
I hope developer’s may not ignore this problem and fix it asap.


#12

Here the same issue, radio app stops playing after 5 minutes on battery with screen off.
Phone connected on the charger, then music don’t stop.

Android 8.0 and with Tunein App it works fine.

Is there allready a fix?


#13

For now you need to do it manually:

You can use the ActivityStarter to get them to the correct screen though:
android.settings.IGNORE_BATTERY_OPTIMIZATION_SETTINGS


#14

Thanks for the information.
But when I Try this It goes to optimize battery usage menu of the phone. (Android 8.0)

Update:

Ok I understand what you mean.