How to identify Fenix 6 series (to get Round_280px)

Former Member
Former Member

Hi guys,

I would like to know how could I identify with some code the Fenix 6 series to set the drawing in the correct position.

Until now, I did it with the next sentence and it worked for Fenix 3 and 5 series:

if( WatchUi.loadResource(Rez.Strings.DeviceModel).equals("Round_240px")) ...

But for my surprise, when I run a simulation with Fenix 6, it returns 'Round_218px', just like a Fenix 3.

Do you know any other method to know the model is currently active?

Thanks in advance. Best regards.

  • There's a few different ways, based on how much you need to know.

    At runtime (in onLayout) in can check for something like width=height=280 and right now, that's only the f6x.  width=height=260 could be the va4, S62, or f6 though, and width=height=240 is a whole bunch of devices.

    At compile time, you can use jungles.

    Or you can use resource overrides.

    See the programmer's guide for the last two.

  • Former Member
    0 Former Member over 5 years ago in reply to jim_m_58

    Thanks for the suggestion! I solved with width and height check:

      function onLayout(dc)
        {   
            if( dc.getWidth() == 280 && dc.getHeight() == 280){
                System.println("Type Device = Round 280px");

    .....

    I hope this will be helpful for any other programmers ;)

  • The screen sizes on the fenix6 devices are as follows

    fenix6s/pro 240x240
    fenix6/pro 260x260
    fenix6x/pro 280x280

    The resourcePath definitions for the fenix6 devices (in bin/default.jungle) confirm this:

    $ grep "^fenix6[^.]* =" default.jungle
    fenix6 = $(round-260x260)
    fenix6s = $(round-240x240)
    fenix6spro = $(round-240x240)
    fenix6xpro = $(round-280x280)
    fenix6pro = $(round-260x260)
    
    $ grep "^fenix6[^.]*.resourcePath =" default.jungle
    fenix6.resourcePath = $(fenix6.resourcePath);resources-fenix6
    fenix6s.resourcePath = $(fenix6s.resourcePath);resources-fenix6s
    fenix6spro.resourcePath = $(fenix6spro.resourcePath);resources-fenix6spro
    fenix6xpro.resourcePath = $(fenix6xpro.resourcePath);resources-fenix6xpro
    fenix6pro.resourcePath = $(fenix6pro.resourcePath);resources-fenix6pro
    

    If you're seeing a string resource return an unexpected value, it seems that it is an issue with your project (probably a jungle file or resource override issue).