Help with android permissions

How can I prevent the phone from sleeping?

Hi, you can use this component
https://docs.kodular.io/components/screen/#keep-screen-on

3 Likes

Sorry, I really wasn’t clear.

come on!

I have a radio streamig app you open it from play it plays the audio normally however when the cell phone screen closes the android hibernates the apps by default and together the stream plays at the moment, how to avoid this without having to go to the settings advanced android battery?
Is there a possibility with a certain permission?

You can’t.

No.

2 Likes

This extension may help extend the time but without a Service, Android is going to eventually kill it:

3 Likes

Thank you very much friend

1 Like

:hugs: Thank you very much friend

1 Like

how could I call this action by the start of activity
ACTION_REQUEST_IGNORE_BATTERY_OPTIMIZATI

I believe the extension does this for you.

Check this radio app (APK) on your (test) devices:

We have discussed the problem with audio streaming intensively also in the AI2 (power user) forum among the power users and the App Inventor team. There currently doesn’t seem to be a solution for some devices (especially with Android 9).

(Unfortunately I can not refer to these threads because they are only visible to power users.)

@Ken Does my test APK work on your S8 (Android 9)?

1 Like

With these settings:

It continued to play for a long time(I didn’t time it) but it did stutter a few times.

Something weird happens when I click on my Recents button. I’ll PM you the Video.

I ran it on Screen2 for 25 minutes and it continued to play with these settings:

1 Like

in this case without using the extension since my app is published on Google Play?

You could try explaining why the Battery Optimization is necessary for your app but it’s up to Google to decide if your explanation it sufficient.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.