VERY Simple sample of a watch face with a background process.

This one really doesn't do much. It displays the time, an indication if it's on a device that supports background processes (you can see how that's checked in the App Class), The count of the times the background process has run, and the data returned from the background. It does cache data in the object store, so after the first time the background runs, it will have data.


The background process is a Temporal event, and runs every 5 minutes. All the background does is return a string with a time stamp (HH:MM). There are a number of Sys.println() calls to see what's going on. If you have a watch that supports background processes (f5's,chronos,935,735,va-hr), create a <myapp>.txt in logs to catch the println() calls, as you see kind of a neat thing where those that come from the background are marked as such!

This runs in the sim can you can use the code to build a sideload. In addition to devices that support background processes, I included the fenix 3 as a target so you can see how it works on a watch that doesn't.

if you have questions about the code, just ask!
  • Hi Jim,

    I am hoping to code a Fenix 6X Pro watch face that has the time, date and tide on it (all in big enough font for my poor aging eyesight). The problem is I am not a computer programmer, but my son has installed Visual Studio Code and all the Garmin bits on my laptop and I have been able to get the watch face simulator working. After approximately 25 hours of Googling and experimenting, I have learned to add the date and change the font sizes and colors on the sample watch face that appears when I open a monkey c project.

    But I am really stuck at trying to get the tide data from Stormglass.io. I have Googled endlessly for code examples and I have spent hours asking ChatGPT for help (all of its example codes have failed). Three times I have read this entire thread that you started more than 8 years ago, and I downloaded your original zip file and got it working in the simulator (until I tried to change to a Fenix 6X watch). But I couldn't find anywhere in your project code where "WWW" or "HTTP" was written so I don't even think your background data is coming from a website. Is that correct? So now I'm feeling a bit stuck. Can you please tell me; to get tide data from Stormglass.io, should I be using getBackgroundData? Or makeWebRequest?

    Do you know where I could possibly find any working examples of code that use the correct one for me please?

  • If you want a watchface that displays tide data, then you don't need to reinvent the wheel, there are watch faces you can find by searching for "tide" in Connect IQ

  • Thanks. Yes I've tried all of the watch faces with tides on them. I have even written to a few of the developers to ask if they would share their code with me so that I could modify the font size but unfortunately the answer was always no. I've also tried all of the tide widgets. Unfortunately none of them are suitable for my poor eyes either due to the font size. Trust me I don't want to be sitting here for days on end trying to learn how to do this (although I am always interested in learning new things but this is getting a bit much).

    I have also tried that great (for newbies like me) site watchfacebuilder, but unfortunately it's tide data is limited to the United States. I have requested that they allow access to stormglass so world tides could be used but unfortunately I got no response.

  • Maybe if you asked the "right" thing they would be more helpful? Why not asking them about bigger font? Nobody will share their code with someone they don't know unless they already shared it on github

  • Yes. Again you are correct. The first thing I asked was if they could please make bigger font available. Two of them agreed and did just that but the font was still too small for me. So instead of continuing to bug them about such a simple thing as formatting, I asked if I could possibly have the code so I could learn to do it myself. That way I could leave them alone and sit by myself for hours tweaking the trivial beginner things like font sizes, colours and positions. 

    And I didn't know that nobody would share their code with someone they don't know, because, like I said, I'm new to all this, And I would think that if I was clever enough to make a code that a newbie was interested in I would share it with them because  it seems to me that would make watch face designing much more efficient, rather than having new people spend months learning the same thing that other people have already learned. But that's just me.