Screen being cleared on onUpdate

Hi everyone, I'm currently working on my first Watch Face and decided to replicate the partial updates philosophy to the onUpdate function and at every second I would only update the fields that would make sense to be updated every second (like heart rate), some others (like device battery) would be updated only once per minute (well, every electron saved counts). Everything went fine on the simulator, but when I compiled and moved to my real watch (Venu 2), the screen would be fine for 1 second (the first full draw) and then completely black, only the heart rate was drawn. Am I right to assume that the dc is not preserved between onUpdate() calls? And is there any way to revert this? Thanks in advance!

Bruno Bragança

  • Some devices clear the screen before onUpdate and some don't.  The sim doesn't show this.

    The only time you can update only part of the screen is in onPartialUpdate.

    it gets worse on real devices where a notification or toast can wipe out part of the screen.

    This has come up on a ongoing basis and the answer is, when onUpdate is called, ALWAYS update the whole screen

  • Thanks for the clarification Jim. I guessed that but I had a small hope that there could have a setting in the manifest or something like that that would allow to preserve the dc between onUpdate calls. So, I think I'll have to keep reading the battery every second...

  • You need to understand how the sim works vs a real watch for a watch face.  In the sim, by default, it's high power mode and onUpdate is called every second.  On a real device, after a gesture or tap, it will switch to high power for the matter of a few seconds, then drop back to low power where onUpdate is only called once  every minute.

    onEnterSleep/onExitSleep in a watch face allows you to know if you are in hi or lo power

  • If you use an off-screen buffer, you can just output that to the main display as long as nothing needs to be updated, and only re-draw the watch face, e.g., if the minute changed since the last time it was drawn, if nothing needs to be shown more frequently. The seconds can still be added directly on the main display after that.

  • Yeah but I guess that saving the screen to memory buffer is less battery effective than redrawing the entire screen. I think I'll just do like Jim said and redraw the entire screen on onUpdate. Thanks for the insight.