Problem with clock



I have a problem with clock. I would like something like 10s to do something. When the phone is switched on, everything works correctly but when the phone turns off the time countdown stops pommo that the application is on the white list. Sometimes when the phone turns off 2-3 it will do what it has to do and suddenly stop working.


if you want clock work when phone sleep you need turn on “TimerAlwaysFires” in Designer - Properties


Thanks for reply…

Yes, I know, I have it checked and there is still a problem that after a few starts it stops working. The second strange situation is setting the interval for 10s and when the phone is switched on, in fact the operation is performed every 10s but if the phone turns off, the operation is performed differently after 5s and sometimes after 30s and then not at all.


Because i cant see all your block so I not sure this is a course of your problem :1
I think this value you should change to Variables
i think it will work


I changed my code but it’s still the same.
I attach the log from the application connections as you can see the first 4 items when the phone is switched on, it works perfectly every 10s when the phone turns off it starts to operate randomly.
my new code:



any idea why not working?


None of the versions of App Inventor (AppyBuilder included) has the ability to work in the background yet. So that is not possible at the moment.


you might want to keep the screen on
there is a method in the KitchenSink component for that


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


ok but why work 2-5 min and stop working …


Taifun it is good idea but how to walk with the phone switched on? :slight_smile: a lot of things can stick in your pocket …


anther solution could be to use some service, which starts your app regularly to post that text, for example How to start an App Inventor app using Tasker by Gekko


Could you write something more about your second suggestion?


I never used Tasker myself…
check the link I provided earlier and for details ask in a Tasker forum



Because your app is suspended, that means it is available for a “fast reopening” in memory, but as soon as your device needs that memory for other apps or processes, it will close your app.

If an app really works in the background, it claims its place in memory and is not killed when the memory is needed.


Thank you very much for the explanation. Do you plan to add the functionality of applications running in the background? If there is more RAM in the phone and few applications running, can this minimize the killing of my application?


AppyBuilder(AB) is built on AppInventor(AI), AI was working on adding Background Services but the progress has stopped for now. We hope it will be added in the future.
That being said once AI implements this, AB can add it.