I have made an app to make balance inquiry that calls multi numbers sequentially, and its important to work when the device locked.
I tried with tow devices, the first one was Samsung Galaxy J2, It works well even if I lock the screen still make calls, the second one was Galaxy A5, had the same problem you discuss about.
Is there any difference, between them?, I still searching for some setting to configure in the second one.
App Inventor apps not really are able to run in the background...
a workaround might be to keep the screen on, however this will drain the battery...
see also
The Android version of galaxy J2 is 5.1.1, for A5 the Android is 8.0.0
The block is a simple loop uses list of phone numbers and clock to make delay between calls.
There are many misconceptions about the term background. Background as used here means only that the app is not visible (eg after pressing the home button or after time-out / in sleep mode), but not closed. Background tasks / services means that an app can also execute somthing if the app is closed. That’s indeed not possible with AI2 & its clones (Thunkable, Kodular, …).
Check this app: activityLifecircle2.aia (33.7 KB)
(with Companion or APK):
Open the app, press the device power button to set the device in idle (sleep) mode (black screen), wait ... and bring the app to the foreground.
Question: Is the counter (sec) running?