App in background and alert me after evry 20 minutes only if person is actually using the phone

I want to create an app which runs in background and alert me after every 20 minutes only if person is actually using the phone (not in sleep mode) Any idea how`s it possible ?)

Use this extension to run app in background-

Try this APK (maybe this is what you want):

To check this:

  • press the device Home button and wait 10 sec: β†’ Alarm sound after 5 sec and after 10 sec ...
  • press the device Power button (β†’ idle / sleep mode, screenOff), wait: no Alarm
  • wait until the device switches into idle mode (screen timeout setting, maybe 10 sec): β†’ no Alarm

1 Like

as far as I understand you are interested in monitoring app usage information and after 20 minutes of usage of one or more apps without pause you like to get a notification

this will not be possible with currently available App Inventor components or extensions

it might be possible with an extension, but the extension first would have to be written and as far as I can see, it would be a challenge anyway... see also this stackoverflow answer

and as it is an answer from 2013 see epecially the Lollipop+ chapter there


Trying to push the limits! Snippets, Tutorials and Extensions from Pura Vida Apps by icon24 Taifun.

1 Like

As far as I understand it, a notification / alarm should be triggered every 20 minutes as soon as the app is in the background (screen not visible), but the device is not in idle (sleep) mode. Exactly this can be tested with my test APK.

Of course, the app must not be closed.

I updated the APK (Google Drive link), see above.

Can I have the code or extension for this. I will customise as per more needs.?

Thanks in advance.

Is it working the way you want?

Upto some extent it's similar to what I have developed using subtraction of app resume time and app paused time. And then play a sound every one second after this happens after 20 minutes.

Ok, but without knowing when and whether the screen is off (device in idle / sleep mode), there can be no solution in your sense.

No I didn`t mean this. But could you tell me is your app paid?

checkIdleMode.aia (25.5 KB)

For the extension, see here:

1 Like

Thanks for your support. Hopefully I will create what I wanted to show to my kids.

Yes, and show us the result when you're done.

Sure I`ll definitely let you know. Thanks again.