Widgets for Fenix 6

Thanks Garmin for the SDK update, 3.1.3 allows to get watchface and data fields easily for the new watches, but doing the same job for widgets means some work...

Recompiling an "old" (fr935/fenix5) widget for the fenix6 shows only a small icon and the name of the widget which can be scrolled up and down using the keys but that's it. Does anyone have a small example source code for the new widget type?

Parents
  • I believe adding the (:glance) annotation just make is easier for the compiler to exclude those functions and classes from devices that don't support glance views.  If you leave it out, everything will still work, but the compiler will give you a warning that it supports glance view but contains no annotations.

    When running in glance mode, the app has less memory available to it. The (:glance) annotation lets you specify which code needs to be available to glance mode. If your application is small, you can probably get away without the annotation at all, but at some point you'll start running low on memory.

    One further thing to watch out for, besides the memory, is that the glance view doesn't support everything the main widget view does - Positioning isn't available, where Sensor is. Not sure what else, and it would be handy to have the differences documented. Below is the Glance from the widget I mentioned - the main view gets your location and does some web calls to evaluate the elevation and atmospheric pressure where you are, the glance view reads those from sensor info, so will give you a live value albeit dependent on your current sea level calibration.

Reply
  • I believe adding the (:glance) annotation just make is easier for the compiler to exclude those functions and classes from devices that don't support glance views.  If you leave it out, everything will still work, but the compiler will give you a warning that it supports glance view but contains no annotations.

    When running in glance mode, the app has less memory available to it. The (:glance) annotation lets you specify which code needs to be available to glance mode. If your application is small, you can probably get away without the annotation at all, but at some point you'll start running low on memory.

    One further thing to watch out for, besides the memory, is that the glance view doesn't support everything the main widget view does - Positioning isn't available, where Sensor is. Not sure what else, and it would be handy to have the differences documented. Below is the Glance from the widget I mentioned - the main view gets your location and does some web calls to evaluate the elevation and atmospheric pressure where you are, the glance view reads those from sensor info, so will give you a live value albeit dependent on your current sea level calibration.

Children