Trouble with my timer


#1

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
Thomas

Timer.aia (6.7 KB)


#2

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.


#3


Timer_New.aia (6.8 KB)


#4

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


#5

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


#6

Hello,

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
Thomas


#7

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?
Greetings
Thomas
Timer.aia (59.2 KB)


Any Tutorial for DialogAny Extension?
#8

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


#9

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
Thomas


#10

did you try by tick timer always fire?


#11

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

Greetings
Thomas

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


#12

i like your interface design its simple clean and attractive


#13

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


#14

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
Screenshot_17


#15

keep screen on appybuilder extension


#16

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


#17

Hello Sir please help me


#18

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

Thomas