How to determine if F3 or F5?

Hi

sorry for this beginner question...
How do i determine if my watchface is running on Fenix 3 Fenix 5 or any other out of the 10 Garmin devices?
2 years ago i just checked the dc.getWidth() & dc.getHeight() for this.... now with SDK 2.1x SDK1.xx its a bit more complicate...

Cheers
  • You can use resource overrides (see the programmer's guide), or maybe just add a bit more smarts in your code. (it depends on what you want to do and when - compile or runtime)

    For the f3 "like" and f5 family, the screen shape is "round" (Sys.getDeviceSettings().screenShape). The width also == height on these.

    For 218x218, you have the f3, f3hr, chronos, d2 bravo, and f5s

    and for 240x240, the f5, f5x, and 935

    You can see which 218x218 are "f5 like" (the f5s and chronos) by checking Sys.getDeviceSettings().monkeyVersion and seeing if it's 1.x or 2.x CIQ.
  • For most situations, if you're trying to determine which device you are on, you are asking the wrong question. Do you really need to know what device you're running on, or are you trying to figure out some other information about the device (screen resolution, screen shape, color depth, connectiq feature availability, ...).

    What exactly are you trying to do? Maybe we can help you do it a better way and save you some trouble at the same time.

    Travis
  • Hi
    Thank you for detailed response.

    This will solve my issue.
    Sys.getDeviceSettings().monkeyVersion and seeing if it's 1.x or 2.x CIQ.

    I wanted to show a HR Diagram which only works on 2.xx.
    Now I can check for monkey version before I call the HR functions and show a "sorry not on F3 supported" message on older devices.
  • For that kind of a check, you can also look at using "has" (see the programmer's guide). You can check if you can use something that way too.
  • Exactly. This should do the trick...

    using Toybox.SensorHistory;

    // snip...

    // in your code somewhere...
    if (SensorHistory has :getHeartRateHistory) {
    }


    As Jim mentioned, this is covered in the Programmer's Guide here.