I have a Vivoactive 4S and am using Connect IQ v3.1.9 on a Windows 10 laptop. I want to display a message on the phone every alternate evening to remind me to take a tablet (a pill not an iPad lol!). I am using a version of the Analog clockface example that came with v3.1.9 and have modified (amongst other things) the drawDateString function to do what I want. drawDateString is called as part of the onUpdate function and the relevant code is:-
var takeTablet = false; // Class declarations
var tabletSeconds = 59; // ditto
if (info.hour == 5 && info.min == 0 && info.sec <= tabletSeconds) {
takeTablet = ! takeTablet;
tabletSeconds = info.sec;
System.print("tabletSeconds = ");
System.print(tabletSeconds);
System.print(" - takeTablet = ");
System.println(takeTablet);
}
if (takeTablet && (info.hour > 21 || info.hour < 5)) {
dc.drawText(x, y+24, datefont, "Take Tablet", Graphics.TEXT_JUSTIFY_CENTER);
}
This all works fine in the simulator with Low Power Mode set but not at all on the watch itself. As far as I can see the 'takeTablet' boolean is never changed. I don't think that my code is at fault (hubris not being a fault of mine!!!) because it works properly in the Simulator so what is it that is different on the watch? And, more importantly, what should I do to get it to work?