Big problem with WatchFace class!

I decided to make quite complicated watch face and at the beginning I wanted to check how my functions will be called by the WatchFace class. My surprise was quite big.

1. WatchFace has been started and my Epix LIES on the table. Function onShow is called periodically each time with new instance of my 'myView' !!! Each time my application was killed and restarted!

2. I not always call 'View.onUpdate()' in my onUpdate function because i must update only digits of seconds. Unfortunately some times my view is destroyed and I see Garmin's digital watch face! This happens every time after Ui.requestUpdate() and in other unknown to me (quite random) cases.

My layout is complicated and I call 'View.onUpdate(dc)' only once at the beginning and then only some parts of view are updated. Extortion refreshing the entire screen each time leads to significant battery drain.

Please Garmin, do not touch my view. If you must just call onHide before and then onShow. This will give as weeks more battery life. In my opinion constantly showing seconds without redrawing entire screen will use less energy then today's complicated watch face.

Thank you for reading this.
Peter.

3. Very cool would be to have a function in the View class: View.CallOnUpdateAfter(seconds) or unlocked Timer. This will not drain battery, battery is depleted as a result of malfunction View or WatchFace class (or both).

Thank you for reading this,
Peter.
  • Hi,

    the watchface is always destroyed when you go to another screen and it is initialized (new instance created) when you go back. In this moment, VM will call initialize(), onLayout(), onShow() and onUpdate(). You have to render your watchface completely in this case. Another case is automatic refresh once per minute, or once per second when you are in high power mode (i.e. when you make a wrist turn). onUpdate() is called each time and it up to you if you want to redraw the screen, but your clock time might stuck if you don't :)

    Good approach is to calculate complex data only after initialization or when it is necessary, but do clearing and rendering of the screen each time onUpdate() is called.

    Ui.requestUpdate() is not commonly needed for watchfaces, maybe if you detect that user settings has changed.
  • Ui.requestUpdate() is not commonly needed for watchfaces, maybe if you detect that user settings has changed.


    Actually, another time I use it is when entering or leaving low-power mode. (enterSleepMode(), exitSleepMode(), with a boolean set to indicate the mode so seconds can if displayed if not in low power mode, and cleared right away when entering low power mode)
  • Ok, I understand that as new app is started mine will be killed. That is no problem, the calculation can be stored in a storage but still drawing a complex view takes valuable CPU time.

    Is it possible that WatchFace class (as it already has to destroy my view) gonna use some other (fake) Dc object instead of mine?
    It should not be difficult to implement and significantly save the battery.

    As we will waiting for this small correction;), is it safe to store Dc for which my layout was build and use it in onEenterSleep instead Ui.requestUpdate?

    Peter