Ticket Created
over 2 years ago

WERETECH-12673

Improve documentation: Add api levels and system levels to Device Reference

Please add information about the possible system level and api level each device can have to:

https://developer.garmin.com/connect-iq/reference-guides/devices-reference/

For example:

Fenix 6:

min system: 4

max system: 5

min api: 3.2.0

max api: 3.3.*

(maybe the max values should only be set when Garmin has decided that a certain device will not get further updates)

The use case is that it can help developers to decide which devices they support. When they decided it can help optimizing code by excluding code that is "too new" for a device. For example there's no need for the following code on system 1 devices with max api level < 2.4.0, because they can never have Properties:

function setConfig(key as Application.PropertyKeyType, val as Application.PropertyValueType) {
    if (App has :Properties) {
        App.Properties.setValue(key, val);
    } else {
        App.AppBase.setProperty(key, val);
    }
}

By knowing this we can save some precious bytes in the memory if we use:

(:system2)
function setConfig(key as Application.PropertyKeyType, val as Application.PropertyValueType) {
    App.AppBase.setProperty(key, val);
}
(:system3)
function setConfig(key as Application.PropertyKeyType, val as Application.PropertyValueType) {
    if (App has :Properties) {
        App.Properties.setValue(key, val);
    } else {
        App.AppBase.setProperty(key, val);
    }
}

Parents
  • With my apps, I usually use a min API level of 1.2, and based on which target devices I enable, can exclude some things - Like Garmin weather.  I don't even have targets that won't be 3.2.x or greater.  And even then, use "has" where needed  (if (Toybox has :Weather) {}), as that handles things like APAC devices that might not have something "today" but will next week, and I don't have to change anything.  The app adjusts without me worrying about the APAC FW releases....

    I think you're worrying about things you don't need to worry about with proper coding.

Comment
  • With my apps, I usually use a min API level of 1.2, and based on which target devices I enable, can exclude some things - Like Garmin weather.  I don't even have targets that won't be 3.2.x or greater.  And even then, use "has" where needed  (if (Toybox has :Weather) {}), as that handles things like APAC devices that might not have something "today" but will next week, and I don't have to change anything.  The app adjusts without me worrying about the APAC FW releases....

    I think you're worrying about things you don't need to worry about with proper coding.

Children