1hz Watch Faces - Q&A

I'm not sure if many folks have been trying the new "always active" watch faces in 2.3.x, but the 2.3.0.beta1 has been out for a month or so now. It's probably getting close to the 2.3.1 SDK release, and thought I'd start a Q&A for the feature, and start with some of what I've picked up in adapting a number of watch faces to use 1hz.

I'll be calling this feature "1hz", as that's what it really is - being able to change the screen on a watch face every second.
The most common thing will likely being the ability to display seconds all the time. One thing I'll note right off, is while you can update the screen every second, the underlying data still changes at the rate it did before, so if you use 1hz for the HR, you won't see the HR change every second.

A few basics.

  • 1hz is only available on some watches. The f5, f5s, f5x, 935, and Q5, but if you support a bunch of different watches, you can easily have it on some and not others.
  • 1hz happens by way of a new onPartialUpdate() for watch faces. onUpdate() is just like it was in the past, and when you are allowed to do a 1hz update, onPartialUpdated() is called. You don't have to change a thing in your code if you don't want to use 1hz.
  • onPartialUpdate() is VERY strict as to how long it can run. You have a "power budget", and the rule is that each minute, the average run time each second can't be greater than 30 milliseconds. This is the tricky part! :)



I started with the Analog Sample in the SDK, which does show what to do, but has some things you don't need to do for digital watch faces - there's no second hand passing over a bunch of different places on the screen with a digital one. The time is in a fixed spot on the screen in most cases.



Anyway's, the first thing I did was cut back to the basics of what was needed for a digital WF. I'll attached a project with a very basic 1hz watch face, but first a few notes about it.

  • vs1hzapp.mc shows how to use the delegate for the power exceeded deligate on watches that have 1hz, and still run on watches that don't do 1hz.
  • vs1hzview.mc I tried to comment as to where to do things, where not to do things, but took a simple approach where I don't just update the seconds at 1hz, I actually do hh:mm:ss. In real code, you likely have a separate space for seconds, and your setClip() will be adjusted for that. I just wanted to get the ball rolling here :). Also, note onEnterSleep() and the code there for 1hz...
  • In onPartialUpdate(), I have a comment about a simple change to make the watch face exceed the power budget, so you can see how that works



Ask questions, suggest other ideas, whatever. That's what this thread is for!

So here's the project! (it might be a bit different than the original one that was lost in the forum update) :

VS1hz-old.zip



NOTE: I should have mentioned this before, but you want to use a 2.3.x SDK for this project!

  • Look at onExnterSleep and onExitSleep in the sample I posted, as that might be it. If the WF is in 1hz mode, don't do a Ui.requestUpdate. For digital WF, it was kind of a "jitter". without that check
  • I'm running EuroPilot with 1Hz constantly and I am not seeing the bug...
    but yes Jim is right. Must be something to do with that Ui.requestUpdate()
  • Look at onExnterSleep and onExitSleep in the sample I posted, as that might be it. If the WF is in 1hz mode, don't do a Ui.requestUpdate. For digital WF, it was kind of a "jitter". without that check


    I do still have the Ui.requestUpdate in both EnterSleep and ExitSleep. Perhaps, a quick check for 1Hz, or are they simply not needed at all?

    Thanks for the help!
  • I'd keep them but do the check (that do1hz I mentioned before is what I use).

    if(!do1hz) {Ui.requestUpdate();}
  • For 1Hz support does the project have to strictly be SDK 2.3.x?

    Can the faces still have 1Hz support on SDK 2.2.x?

    Seems the Approach S60 is not SDK 2.3.x compatible at the moment.
  • I build with the 2.3.x SDK, and I have watchfaces that run on basically any watch, CIQ 1.x or 2.x, and with or without 1hz support. No reason to use a 2.2.x SDK at all any more.

    The sample I posted will run on 1.x and 2.x devices for example.
  • I build with the 2.3.x SDK, and I have watchfaces that run on basically any watch, CIQ 1.x or 2.x, and with or without 1hz support. No reason to use a 2.2.x SDK at all any more.

    The sample I posted will run on 1.x and 2.x devices for example.


    I'm asking more from a support perspective. The APAC devices and Approach S60 aren't listed as 2.3.x compatible in the SDK and they can't find my WF on the store. I'm wondering, if I build for 2.2.x, will the 1Hz still work? It seems to work for me.
  • Correct, you can still build for 2.2.x.
    1Hz will work as long as you have FW v2.80 installed on the S60, since that added CIQ 2.3.2 support.

    I can confirm as I have NoFrills with 1Hz published to the store and it runs perfectly on S60.
  • I rarely, if ever use anything but the default minimum CIQ version when I build, and right now, have WFs that use the S60, etc, in the store. What happens is as soon as they get the FW with 2.3,x VM, 1hz will start being used. No need to update the store or anything, The key is figuring out if 1hz is available at runtime. That's where the "do1hz" I mention comes into play. It's initially set in initialize based on a "has" for onPartialUpdate. If the FW supports onPartialUpdate, it runs in 1hz mode. If not, it doesn't.
  • Both types of SensorHistory only have new data every 1-2 minutes. On some watches, you can get faster updates if you include looking at Activity.Info.currentHeartRate. Basically, look at currentHeartRate first, and if it's null, use history..

    Try my "Simple Heart" if you want to see this in action.


    For others that might be wondering how to access it in the code... and yes it took me way to long to figure out why my HR wasn't updating fast enough :)
    var currentHR = Activity.getActivityInfo().currentHeartRate;