Watchface: My Day 24

Hello, I have created a new round watch face My Day 24. You can see your activity in the last 24 hours. Sunrise and sunset time is displayed in the outer circle. The second circle shows the sleep time and a sleep quality (deep sleep, light sleep). The inner circle is your heart rate history in the last 24 hours. Download here

Currently both Fenix 3 and Fenix 5 are supported (as well as Vivoactive 3 and FR935), just the Fenix 3 does not support the sleep detection (background tasks are not supported on this hardware). This watch face is still in development, I plan to implement more customization options later (different data fields, custom colors, status icons for alarm and notifications, different fonts etc.). You can send me your feedback, what would you like to implement :)


Sleep detection
I have implemented my own algorithm for sleep detection. When this watch face is active, it reads every 5 minutes data from the accelerometer. The time of the sleep that is displayed can be different from the time displayed in the Garmin Connect app. I hope it works well on every hardware and with every person, I have tested it only on the Fenix 5S. But it seems to be working well :)

Heart rate data
The inner circle shows the heart rate in the last 24 hours, every bar is a 15 minute time period. When you start this watch face, only the last 4 hours are loaded from the history. You need to wear it whole day to get all the data.

Sunrise and sunset
The sunrise time is calculated from the GPS position from the last activity. If you see a gray circle on the first startup, just open a running / cycling activity, wait for a GPS fix and return back to the watch face.


Developing for Garmin devices was an interesting experience :) I can say that the Monkey C is pretty easy to use and comfortable language. Mostly I did not have problems with low memory of these devices, just with the speed performance. When I created the first version of this watch face, loading took more than 2 seconds, it was unusable. I had to optimize almost every piece of code. Some recommendations for other developers:
  • Accessing global arrays is very slow. It is better to copy the array to a local array each time onUpdate is called, and then access only this private array.
  • Also calculation of values is slow (sinus, cosinus...), it was better to calculate the values once, then save it to a storage. In the next onLayout load it back from the storage.
  • Do not use many methods, do not use a lot of classes... It's better to inline everything, and even duplicate the same code in two different methods.
  • Do not use dictionaries (as dynamic arrays). Do not create many properties (even for int / float numbers). For example in the for cycle, create just one property at the beginning of the method and then reuse it.
  • Use offscreen buffered bitmap with a fixed color palette (cannot be used for antialiased fonts, but these fonts can be drawn later over this bitmap)
  • String objects are slow, Double objects are slow, it's better to optimize everything just for Numbers (integers) or Floats.
  • Be sure that you do not calculate, or draw anything more than you need. Forgot some auxiliary variables, intermediate computations or debug outputs, just calculate everything on one line and just once.
community.garmin.com/.../1265780.jpg community.garmin.com/.../1265781.png community.garmin.com/.../1265782.png