Watch face options do not work

Former Member
Former Member
Hi,

I just created a new watch face with configuration options. I uploaded it into store because as far as I know that is the only way to get configuration options to a real watch. Side loading does let me configure the watch face. The watch face name in the store is ClocJx. I do not expect it to be a huge success as there are already many great watch faces available :-) It is just a fun project for me, and it is cool to run my own clock face.

When I tried the watch face in the simulator all worked fine. Zero problems. I have Fenix 3 but in the simulator I tried some other watches and they worked fine too. I had some trouble to get all the details sorted out but this forum was very useful resource. Side loaded app also run fine (but without the ability to configure it).

Now the real problems started when I downloaded my watch face from the store to a real device. Initially it looked just fine. I do see the configuration options in my phone but when I change anything everything goes bad. I see only some items that I draw to the screen. Most items just do not show up in the screen. After the first configuration change I do not seem to be able to change anything although the phone reports that change was fine.

My watch face is rather big as I have a couple of optional background images there. In the .iq files there are multiple versions, some are 100KB and some are 200KB. Could the size be a problem?

Any other ideas what could be wrong, or how to debug in the real device? I do not use layouts, I use default fonts. I write all text using dc.drawText and for graphics I use dc.fillPolygon, dc.drawLine and dc.fillCircle. The background image is done using dc.drawBitmap. I do all these calls inside onUpdate function.

Thanks,
Jarmo
  • Former Member
    Former Member over 9 years ago
    I removed large background images to see if they make a difference. That did not help. Still after the first configuration change the clock resets to an odd state. Maybe there is a default watch showing just digital time when the watch face crashes. Sometimes the watch face just stops. When I had a version with background image it showed the image but no text on top of it. I did not see any of these problems when using the simulator which is bit odd.

    Jarmo
  • Could you post the properties and user settings you have in resources? The code in your app where you read the properties? What are you using to change the settings on your watch? GCM (iOS or Andriod) or GE? What isn't happening you expect to happen?

    Does it work with the "app settings editor" in the simulator?
  • Former Member
    Former Member over 9 years ago
    Thanks for the reply.

    Below is properties.xml

    <properties>

    <property id="appVersion" type="string">1.0.2</property>
    <property id="BackgroundColor" type="number">0x000000</property>
    <property id="ForegroundColor" type="number">0xFFFFFF</property>
    <property id="BackgroundImage" type="number">0</property>
    <property id="DigitalClock" type="boolean">false</property>
    <property id="Use24hFormat" type="boolean">false</property>
    <property id="MountainMode" type="boolean">false</property>
    <property id="Steps" type="boolean">false</property>

    </properties>


    And settings.xml:

    <settings>

    <setting propertyKey="@Properties.appVersion" title="@Strings.AppVersionTitle">
    <settingConfig type="alphaNumeric" readonly="true" />
    </setting>

    <setting propertyKey="@Properties.ForegroundColor" title="@Strings.ForegroundColorTitle">
    <settingConfig type="list">
    <listEntry value="0x000000">@Strings.ColorBlack</listEntry>
    <listEntry value="0xAAAAAA">@Strings.ColorLightGray</listEntry>
    <listEntry value="0x0000FF">@Strings.ColorBlue</listEntry>
    <listEntry value="0x00FF00">@Strings.ColorGreen</listEntry>
    <listEntry value="0xFF5500">@Strings.ColorOrange</listEntry>
    <listEntry value="0xFFAA00">@Strings.ColorYellow</listEntry>
    <listEntry value="0xFFFFFF">@Strings.ColorWhite</listEntry>
    </settingConfig>
    </setting>

    <setting propertyKey="@Properties.BackgroundColor" title="@Strings.BackgroundColorTitle">
    <settingConfig type="list">
    <listEntry value="0x000000">@Strings.ColorBlack</listEntry>
    <listEntry value="0x555555">@Strings.ColorDarkGray</listEntry>
    <listEntry value="0xAAAAAA">@Strings.ColorLightGray</listEntry>
    <listEntry value="0x0000FF">@Strings.ColorDarkBlue</listEntry>
    <listEntry value="0x00AA00">@Strings.ColorDarkGreen</listEntry>
    <listEntry value="0xFFFFFF">@Strings.ColorWhite</listEntry>
    </settingConfig>
    </setting>

    <setting propertyKey="@Properties.BackgroundImage" title="@Strings.BackgroundImageTitle">
    <settingConfig type="list">
    <listEntry value="0">@Strings.BgImgNone</listEntry>
    <listEntry value="1">@Strings.BgImg1</listEntry>
    <listEntry value="2">@Strings.BgImg2</listEntry>
    <listEntry value="3">@Strings.BgImg3</listEntry>
    <listEntry value="4">@Strings.BgImg4</listEntry>
    </settingConfig>
    </setting>

    <setting propertyKey="@Properties.DigitalClock" title="@Strings.DigitalClockTitle">
    <settingConfig type="boolean" />
    </setting>

    <setting propertyKey="@Properties.Use24hFormat" title="@Strings.Use24hFormatTitle">
    <settingConfig type="boolean" />
    </setting>

    <setting propertyKey="@Properties.MountainMode" title="@Strings.MountainModeTitle">
    <settingConfig type="boolean" />
    </setting>

    <setting propertyKey="@Properties.Steps" title="@Strings.StepsTitle">
    <settingConfig type="boolean" />
    </setting>

    </settings>


    Code to read properties is below. I call it at the start of onUpdate.

    function getSettings() {
    var new_image_num;

    digital_clock = App.getApp().getProperty("DigitalClock");
    Use24hFormat = App.getApp().getProperty("Use24hFormat");
    mountain_mode = App.getApp().getProperty("MountainMode");
    steps = App.getApp().getProperty("Steps");
    screen_shape = Sys.getDeviceSettings().screenShape;
    new_image_num = App.getApp().getProperty("BackgroundImage");
    if (new_image_num != image_num && new_image_num != 0) {
    if (new_image_num == 1) {
    background = Ui.loadResource(Rez.Drawables.bgimg1);
    } else if (new_image_num == 2) {
    background = Ui.loadResource(Rez.Drawables.bgimg2);
    } else if (new_image_num == 3) {
    background = Ui.loadResource(Rez.Drawables.bgimg3);
    } else if (new_image_num == 4) {
    background = Ui.loadResource(Rez.Drawables.bgimg4);
    } else {
    background = Ui.loadResource(Rez.Drawables.bgimg1);
    }
    }
    image_num = new_image_num;
    fgcolor = App.getApp().getProperty("ForegroundColor");
    bgcolor = App.getApp().getProperty("BackgroundColor");
    ...



    I am testing the device settings with Connect IQ Android client. They work fine when using the "app settings editor" in the simulator.

    When I first load the watch face, it looks fine. When changing settings I get either empty screen or just background image. I do not see any text like the current time. After that I cannot get anything on the screen.

    Now the setting on my phone/clock seem to be somewhat sticky since after changing settings I always get just background image even though I do not select it from the settings. This happens even if I remove and add the watch face. I guess I need to reset the phone also to see if that helps.

    I saw the following error

    ERROR: Unhandled Exception
    DETAILS: Failed invoking <symbol>
    STORE_ID: 8dc9c366c4844bd08c02bf89cc90a850
    WARNING: Unfreed memory on exit
    STORE_ID: 8dc9c366c4844bd08c02bf89cc90a850

    in CIQ_LOG.TXT. So I tried to add try {} catch (ex) {} to multiple places where I assume exception could possible. Unfortunately that version did not run even in the simulator, I usually got out of memory errors. Maybe there is something wrong in the exception handling (or I am using it wrong).

    I have done quite a lot of programming so I know it must be something simple and stupid I am doing wrong. I just do not yet see it myself.

    Jarmo
  • Ok, what I first see is that when you getProperties(), you should check the types and range.

    A check for "null" and something like an "instance of Number" for numeric. There have been reports of numeric being returned as a String and not a number.

    (you could use toNumber() for this)

    Also, with older versions of Garmin Express (pre 4.1.11), with lists, it doesn't return the value for the list item, but the index to the list item, and that will result in color values getting messed up





    Also, just a suggestion - you seem to have a boolean for 24 hr mode. Why not use the standard device setting for 12/24 hr in DeviceSettings? (is24Hour).
  • Former Member
    Former Member over 9 years ago
    Thanks for the help!

    I added a lot of checks and conversions for properties and now the watch face configuration works! I was able to try only Fenix 3 and Android but hopefully others work too.

    That odd 24h mode configuration just uses 24 clock numbers on a analog clock at PM. I did not want to mix that with the default setting so I added my own. Not sure if I ever really use this mode.

    Jarmo