wear-oswatch-face-apiwatchface

WearOs Watch Face Format: either gps or custom SourceType?


What I'm wanting to do is make a Watch Face Format watch face that shows the sun position and moon position and phase, and rise and set times. The moon phase is fortunately included in the SourceTypes.

Unfortunately sun and moon altitude angle is not included. What I'd like to do is either: access GPS so I can calculate the solar/moon angles or access some Kotlin code as a data source that can make the calculations.

Or at least have an option in the watch face settings to set the location value from GPS.

Obviously I understand I'd want to be sparing with GPS, and sun and moon calcs to save battery.


Solution

  • So coming back to this the answer is no, but actually yes in a limited sense. The XML doesn't allow any data input, except complications and predefined inputs such as steps and moon phase.

    Basically you can make a complication as data channel. You only get 8 complications per watch face so you have to be sparing. The complication can be in the same app as the watchface. The XML doesn't support text to number conversion so all numbers have to be sent in through a RangedValue as either a min, max or value.

    In the above question I managed to make a complication that calculates sun rise, set and position. Then uses some math slight of hand to sneak them into the watch face.