i have these blocks
i want that the app does/repeat this commands every 50 seconds
You’re almost there by using a Clock
component; Using when Clock Timer
will trigger an event every x
milliseconds.
In order to make it 50
seconds, you need to change the TimerInterval
property of the Clock
to 50000
(note that the value is in ms, so 50 seconds is 50000 milliseconds)
Then, make sure your Clock
(named Clock2
) component has the TimerEnabled
property set to true so that it actually ticks and fires off the event.
then if i want to stop it i create a button to set clock2 to set TimerEnabled to false!?
Infatti, esattamente.
Is it normal that if the screen goes in sleep mode the command are not executed?
Yes, this is normal. But if I remember correctly, enabling TimerAlwaysFires
to true could also work in your case (it enables firing the timer even when the application is not being shown on screen);
i have TimerAlwaysFires enabled but seems not working
while i enable timer via blocks
Just test it with an notifier alert (remove your procedures)
do you mean remove procedures from Clock2.timer?
Yes, just to test that the clock is firing as you expect
i added this but when the screen goes on sleep mode nothing happen i cannot see allerts
do i have to expect that the screen awake?
Yes....you do
Don’t awake but if i set a time shorter than the time for go in sleep mode the screen remain ON
alternatively you might want to keep the screen on...
there is the KeepScreenOn method available in the tools extension
As long as this window is visible to the user, keep the device's screen turned on and bright.
Note: If the screen of the device is on, this will obviously drain battery of your device! Please use this method wisely! You might want to use this method together with the Settings extension to adjust the brightness of the screen.
Taifun
Trying to push the limits! Snippets, Tutorials and Extensions from Pura Vida Apps by Taifun.
thank you so much to everyone!
but is it not possible to take the app in background and working with screen in sleep mode?
Impossible to run an App Inventor 2 app in the background. When your app goes to sleep, it will stop responding. Use a Stay Awake routine as a work around.
Searching on Google I have found service appinventor…
Using tasks can be done??
You also found this
.Noone cannot do tasks using a current Companion. MIT should remove the link.
impossible means IMPOSSIBLE; sorry
**impossible** means IMPOSSIBLE; sorry
ok thanks! if you say we cannot we cannot …
i was only searching a solution!
Will not be supported a solution in future releases?
you might want to read again the message highlighted in yellow
Taifun
Trying to push the limits! Snippets, Tutorials and Extensions from Pura Vida Apps by Taifun.