Trouble with my timer


Hello to everyone,
i need al little help. I’ve try to rebuild a tutorial from the web.

I want to create a countdown that works in hours, minutes and seconds. The user can push buttons with different times and after pushing the countdown begins to count.
But it dosnt work… :thinking:

I have attached my blocks and the aia.

What am I doing wrong? I’m happy about every advice!

Kind regards

Timer.aia (6.7 KB)


I see a couple of issues.

  1. In Clock1.Timer the if statement should be called after you’ve changed millLeft.
    Currently the if statement will always be true the first time because the global value of millLeft is 0.

  2. In leadingZeros you are changing numbers to strings which is ok when setting a .Text value but not not ok when performing math calculations.

  3. What is the purpose of the Global endTime if it never changes?

This isn’t a perfect example but this may help you.

I will check back later when I have more time.


Timer_New.aia (6.8 KB)


Great example. Maybe you could make a tutorial of that? :sunglasses:


I just modified his .aia so it’s not really mine to do that with.



you are great Ken!! :+1:
I had to search for a while to understand what I did wrong. :wink:
But now I understand it. Thank you for the lesson.

Kind regards


Hi to everybody,
I want to share the file here. I modified it a little bit.
The original file (tutorial) is from Taifun and the modifications from Ken.
The aia is a Timer with buttons in second, minutes and hours.

I have tried to insert a second tutorial from Taifun:
Refrain your device from sleeping
but anyway, in this file it does not work. :roll_eyes:
But maybe this file can be used by someone?
Timer.aia (59.2 KB)

Any Tutorial for DialogAny Extension?

is your question about how to keep the screen on?
in Appybuilder you will find a method for that in the KitchenSink component…


Hello Taifun,
thanks for your answer.
The Problem is not to keep the screen on. The problem is, when the user lock his screen manually the timer dont count.
In your tutorial and your file it works fine. But in this file, above, it dosnt work.
I rebuild it exactly as yours but it will not work.
But in your tutorial is it similar problem. The timer counts, but if the screen sleeping the alarm will not start. It starts first when the screen is on again.

I try the timer with the kitchensink component. KeepScreenOn.
But there ist also the problem when the user lock manually, the timer stops.

It seems that there is no way in Appybuilder to run a countdown, in the end “doSomething” while the Screen is off.

Kind regards


did you try by tick timer always fire?


For real?
So easy?
I’m so stupid! :joy:
Much to learn, you have! Says Yoda to me!!!


Edit: It does not work correctly. Strange.
Sometimes it works, sometimes not.


i like your interface design its simple clean and attractive


yes exactly… Appybuilder apps not really can run in the background
therefore keep the screen on and don’t lock the screen


I tried 10 sec 20 sec 5 min 10 min that working properly.
I See your blocks you. You’re using 3 same blocks in all your timers. you can collect them in a procedure and call by a procedure that will reduce your blocks also But maybe that is another topic:wink::wink::blush: Screenshot_16
you can do this too


keep screen on appybuilder extension


set clock timer time to 1000ms
set select always fires to true


Hello Sir please help me


Do you have a question?
It might make sense to speak in full sentences.