App Keep alive always

Like really? Do they all work so flawlessly? It's hard to believe to me. I've tested with lot of those device, I think you are talking about doze mode and not about background services.

Mine is Realme 8i, Android 13

That extension about battery optimization from Taifun is only for Kodular ?

Just use it, it will work fine, use the ask permission block, and you will be granted with a prompt, just allow it and you will be fine.

I used Ulli's test aia and integrated a player that plays a sound every 5 seconds in the background (Doze mode). Is it about something else? If so, what exactly?

But none of my Chinese devices have Android 13.

Behaviors of Chinese ROMs drastically change when the app is in background but the app is swiped out of recents. Those devices have unusual policies of background execution.

Ok, I'll test it later...

1 Like

No, you also can use it in your App Inventor projects


I have a Chinese phone with Android 13, Please send your test apk here, I have problem to access Google Drive.

Did you try it? What was the result?

I tried it last night and I found some interesting results.

  1. I used the modified version that I sent above "ItooXCount_copy.aia" and added Taifun's optimize battery extension. This seems to work ! I will test it a bit further today.
  2. I added Taifun's optimize battery extension to my code but it stopped working so I will try to exclude things to see what's the problem

Where and how did you add that extension? You are telling me that it worked and not worked the same time? I dont get it.

Like I said I added Taifun's extension here

I also tried to include that extension to my code with Mqtt etc and it is stopping, so I'm trying to see what is making it stop

When does it stop? When the app opens? Or when the background process begins? From where you are calling the block in your MQTT project? Show me the blocks

I tested

now on a

  • Pixel 4XL (Android 13) β†’ works
  • Galaxy Note8 (Android 9) β†’ works
  • Huawei P20 Lite (Android 9) β†’ does not work (after the app is removed from recent and screen off)
  • OnePlus 6 (Android 11) β†’ works

Tested on all devices after exiting the app and putting the device into idle mode (screen off).

Can you please try locking the app in the recents menu? Does it work on Hauwei after you add the Taifun's battery optimization extension?


See here

(it should be similar in Hawaei)

Now this doesn't seem to work. It worked ok before for a long time. Now after 5-6 mins it stops counting. When I wake the phone it starts counting again.

Crazy. I need to continue tests to find why this happens


So it seems like Phone specific issue now, do you have any phone specific/app specific optimization turned on? You should double check it.

I'll test your AIA file and see how it goes (you can see from @Anke's test that it works by default on majority of the devices)

It's a non standard process killing that is happening...

Disable phone's battery optimization if enabled, disable any app specific optimization in the App management settings menu.

Also, App Info -> Battery management -> Set it to unoptimized.

See here also: Huawei | Don’t kill my app!