Hello,
I would like to test vibration alarms with the Connect IQ device simulator. In settings menu, vibration is active.
How does it work or signalize an vibration alarm?
Thanks
Hello,
I would like to test vibration alarms with the Connect IQ device simulator. In settings menu, vibration is active.
How does it work or signalize an vibration alarm?
Thanks
where to put WatchUi.requestUpdate() in the App part or view part?
solved it. I put it in onUpdate at the end...I could test it by output System.Println ("Update") and it run trough with frequent updates...Does this use more energy of the battery...(high frequence updates)?
As I've posted, create and start a timer and put the WatchUi,requestUpdate() in the call back for the timer. Doesn't matter if the timer/callback are in your AppBase or the view.
onUpdate is the wrong plavce and will result in onUpdate running all the time. Use a timer that fires every second, every 5 seconds, or whatever.
I observed that the attention.vibrate() is not activated if the watch is in the temporary standby mode... only if it is in active visual mode it works? how do i create a call that also works out of the standby mode (screen black)
Switch to using a timer. It's only 3 lines of code.
ok will try. where do it put the different components in (onStart? App module?). I would like a vibration after 25 minutes and after additional 5 minutes (2 timers I guess). Do I have to stop the timer?
I find that in most widgets and device apps I need a timer for many different things, and generally have it fire every second. Then in onTimer, I count things, like how many seconds are left to display a message, when to do comm, etc.
Creating/starting the timer I often do in the view's initialize. and onTimer is just another function in the view class.
Really helpful function! how and where to stop the timer (or would you just let the timer run further until the app is stopped at all?
have something in mind like:
if (count1==30) {timer.stop();}
I tried:
var timer1 = new Timer.Timer();
timer1.start(method(:vibrate1), 1000, true);
if (count1==30) {timer1.stop();}
but it does not stop
I keep the timer running all the time, because I use it for other things too.
Lets say you want to vibrate after 5 minutes. (300 seconds) with the timer firing every second.
To start the 5 minutes do something like:
makeNoise=300;
Then in onTimer()
if(makeNoise!=0) {
makeNoise--;
if(makeNoise==0) { makeTheNoise();}
}
}
so makeNoise decreases each time onTimer() is called, and when it becomes 0, the noise is made