questions on watchface creation

Former Member
Former Member
Hello to everyone
I wanted to create my own watch face so i started trying
I want to point that i have programmed before in a couple other languages so i am quite familiar
Despite that, i have some problems i can't seem to find solution for
So here we go

1)
I want to add an icon for Bluetooth
At the default watch face when you have Bluetooth off you have no icon being displayed
Once you enable Bluetooth you have an icon being displayed(Bluetooth on but not connected)
Once you connect your phone you have another icon being displayed(Bluetooth on and connected)
So i would say i have 3 "states" for the Bluetooth
I only managed to find this:
Sys.getDeviceSettings().phoneConnected
Which checks if the phone is connected or not
So i have 2 "states" and missing the one where Bluetooth is off
In short i want something to check if Bluetooth is enabled or not before checking if it is connected
How do i do that?

2)
All my code is onUpdate
Meaning that it is being updated every second
Two questions here
Is this effective?
I am asking because i am used to writing very little code at my main class and building other
files for classes functions etc rather than having one huge
Also there are data i would like to record less often
For example i would like to record steps less often for battery saving reasons
I guess i could do that in an if statement but is there anything else better?

3)
Can i test my watch face on my actual watch rather than the simulator?
If yes than how?

4)
I have seen many watch faces that have their own custom settings
I would like to do something like that as well
To start with i haven't yet found a way to check System Settings
I did find 4-5 on the api but that's it
I mean something like that:
"getDeviceSettings().is24Hour"
i would like for example to have two versions of my watch face
one with black background and one with white
Meaning i would have to change icons and colours for many graphics depending on
the backgrounds colour
Are there more on the api that i am missing?
And then how can i create my own custom settings to change from the mobile app?
  • Former Member
    Former Member over 8 years ago
    1. I think you can only detect for a Bluetooth connected unfortunately.
    2. Calculations and loading things that only need to be done once can be down when initializing the app and store results in global variables. This might use more memory but save calculating repeatedly.
    3. With Eclipse there's an option to build the app so you can manually copy the file to your watch via the USB. Or you can export and upload your app to the store, and select the Beta option so that only you can see it.
    4. Try the sample apps in the SDK.
  • 1) With CIQ, phoneConnected is all you can see - connected/not connected. Native watch faces don't use CIQ and can access things that can't be done in CIQ

    2) The majority of time, onUpdate in a watchface is called every minute, not every second. With onEnterSleep and onExitSleep you can see if onUpdate is called every minute, or every second It goes into 1 sec mode after a gesture, and does it every second for about 10 seconds. In general, you want to do the entire screen on each call to onUpdate, because there may have been something like a notification on the screen so you want to make sure nothing is left behind on the screen. onPartialUpdate is different, but if you are just starting, you may want to just not use that right now.

    3) see the programmer's guide in the SDK. You can easily sideload to a real device.

    4) You can check system settings - such as is24Hour, and also have your own app settings for colors, etc. The ObjectStore sample in the SDK shows app settings on the second screen -the first screen is the ObjectStore.
  • Former Member
    Former Member over 8 years ago
    ok i managed to get most
    i got my watch face working on my watch but there was some serious lag
    i have 3 archs so i guess the lag is because of the archs being redrawn again and again right?
    I also noticed something weird
    One arch is for the seconds and ads up a little piece for every second and i also write the seconds next to the arc
    I noticed that is was adding every 2 seconds and after about 10 seconds it would freeze(both arch and timer)
    At the simulator that didn't happen
    Is that just some serious lag or am i missing something?
    I think it has to do with what jim_m_58 said because if i pressed a button it would go to adding 2 seconds again(which is again wrong but definitely better)
    I just didn't quite get how i can resolve this if i want to have seconds running all the time and counting correctly

    I also didn't understand how to add my own custom options
    Where to search and for what?
    Any example?
    Also other than is24Hour, what other settings can i check by default?
    are they written somewhere?
  • I'm not quite sure I understand the first part of your question about the arcs and such. Maybe a screen shot of what things look like?

    For app-settings - custom options - There's info in the programmer's guide, and in the ObjectStore sample there's code for it.

    As far as system settings, it kind of depends on what you will be showing. For example, if you show distance, distanceUnits could be used for miles vs km.
  • Former Member
    Former Member over 8 years ago
    I have 3 archs
    the red one refers to the seconds(number 21)
    the yellow one to the battery(50%)
    the blank one to the steps/daily goal(0 steps)
    at the simulator everything works like charm
    at the watch the seconds and th arch go with two steps
    like this: 10->12->14 etc rather than 10->11->12->13->14
    and so does the red arch
    and after about 10 seconds both red arch and seconds counter freeze until i press a button
    my guesses are that seconds progress by 2 because of the three arch taking forever to draw
    but even if iremove all three archs therefore have no more lag and so i get steps counting by one
    would they freeze after 10 seconds due to sleep mode?community.garmin.com/.../1240975.png
  • Ok, you understand how watch faces work as far as onUpdate?

    After onEnterSleep is called and before onExitSleep is called, onUpdate gets called once a minute. After onExitSleep is called, you'll have onUpdate called every second for about 10 seconds, then onEnter Sleep is called. This is how it works on a real device. In the sim, you can switch back and forth using settings>Low PowerMode

    So on a real watch, the screen will only change once a minute most of the time. For the 10 seconds after a gesture where it updates every second, things are different.

    even with updates every second, you might see steps jump more than one at a time, unless you only take one step a second.

    When you are in "low power mode" - after onEnterSleep and before onExitSleep, you really can't display seconds unless you use onPartialUpdate, but you probably want to hold off on that until you get the basics working. Also, it may not be available based on the device you are building for.
  • Former Member
    Former Member over 8 years ago
    i hadn't understood how these 3 functions worked until now
    Your explanation was perfect
    So everything i have onupdate will update every 1 minutes unless i do something on the watch
    and therefore trigger onExitSleep and therefore everything will update every second for 10 seconds
    and then trigger onEnterSleep
    correct?
    if i get it right the onPartialUpdate function allows me to update something on the watchface on a custom?(every second, every 5 minutes etc?)
    i think i could give it a try
    my device is fenix 3 hr




    EDIT
    the onEnterSleep is only called once and not repetitively right?
    Cause i just thought i could put the seconds there but if it is only called
    once each time that would not work

  • Yes, you now understand the onExitSleep, onEnterSleep, and onUpdate work it seems.

    onPartialUpdate allows a watchface to update part of the screen every second, but it's only available on some CIQ 2.x devices. The fenix3hr is a 1.x device.

    onExitSleep is only called once when you drop out of low power mode and onEnterSleep, once when it enters low power mode.
  • Former Member
    Former Member over 8 years ago
    okay
    thank you very much for your help
  • Former Member
    Former Member over 8 years ago
    I would like to add a battery icon at my watch face
    I want the battery icon to change depending one the battery %
    I have thought of two options

    1)
    I have 5 png's each one representing battery %
    For example 1 bar = 1-20% , 2 bars = 21-40% and so on

    2)
    Creating a rectangle and filling it depending on battery% /100

    Both would work fine for me
    each png is 32 pixels and size 300-400 bytes

    I prefer the idea of having a rectangle since it would be more accurate
    But i am more interested in the option that would be less laggy

    So i am asking
    What would be better in terms of performance?
    Having total 5 png's extra on the project and choosing the suitable one with an if statement
    or redrawing the rectangle without having the extra png's?