Problem with clock

howto

#1

Hello,
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.


#2

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


#3

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.


#4

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


#5

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:


log
2


#6

any idea why not working?


#7

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.


#8

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

Taifun


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


#9

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


#10

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 …


#11

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
Taifun


#12

Could you write something more about your second suggestion?


#13

I never used Tasker myself…
check the link I provided earlier and for details ask in a Tasker forum https://forum.joaoapps.com/index.php?forums/tasker/
https://play.google.com/store/apps/details?id=net.dinglisch.android.taskerm&hl=en

Taifun


#14

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.


#15

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?


#16

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.