Overview of Connect IQ Apps accompanied with source code

I've made an overview on my website of the connect iq apps that are accompanied with source code: http://starttorun.info/connect-iq-apps-with-source-code/
This can be a great resource for starting developers to learn how certain things should be achieved.
(When you use something in your own apps be sure to give credit where credit is due and to respect the license of the open source app (usually the license is available in the root of the source code repo))

When I missed a source repo you can comment on the above post in the comments section (or you can also indicate it below with a reply in this forum thread)

Hope it helps to attract new developers to Connect IQ :)

  • This is great, now that garmin didn't make a search option for this.
    But is there a list somewhere with links to the apps on garmin.com, rather than directly to github. Or simply a list of pictures of what they do and how they look??? First you need to find what you are looking to do, THEN you need the code...  

  • Former Member
    Former Member over 2 years ago

    Salve ho provato a compilare il codice con Visual Studio code ma mi riporta errore per il mio Venu sq2 nonostante il mio SDK aggiornato.

    In particolare mi sarebbe utile capire come assegnare al numero dell'ora (e.g. 3) ad una immagine che rappresenta il 3.

  • With the 4.1.6 and 4.1.7 SDK. type checking is on by default, where things you find on PeterD's site were usually done prior to type checking.  This is probably the reason  for the warnings/errors you see .  In VS Code, in the extension settings, you can turn off type checking, or you can do it on a per project basis by adding this to your project's monkey.jungle file

    project.typecheck = 0

  • Former Member
    Former Member over 2 years ago in reply to jim_m_58

    I tried adding project.typecheck = 0 but when I run the "Monkey C edit program" nothing appears and if I try to run without Debug it reports:

    "Workspace not found" and

    "Connect IQ project not found. Be sure your project has a monkey.jungle file and the project's Jungle Files setting is correct."

    Where am I going wrong? :-)
    Thanks for the help
    Alexander

  • Hi, I have stopped developing my Datarun premium datafields and ultimate datafields. Source code can be found at https://www.vermail.nl/datarun_code/

    I will provide a github location later, as the repositories are still hidden (but as I stopped my paid subscription, they should become visible next month)

  • The result of my recent journey to learn basic Monkey C and the Garmin SDK

    https://github.com/ahuggel/SwissRailwayClock

    An analog watchface with a second hand in both high and low-power mode, date display and dark mode options.

    Besides the WatchFace itself, it implements an on-device Menu2 with a basic time Picker and a settings class to synchronize the options to Storage.

    I'm hoping that by sharing my simple code, others may pick up these concepts more quickly than I did, and I may get some feedback on what could be done better and how.

  • What do you mean "second hand in low-power mode"? It either doesn't move or if it does then you don't understand what low-power mode should be IMHO.

    BTW I think when you assembled the watch you accidentally put the second had "the other way around" :)

  • I think he means low-power mode. As far as I know, onPartialUpdate() allows CIQ watchfaces to implement a seconds hand in low-power mode (for non-OLED devices)

    https://developer.garmin.com/connect-iq/api-docs/Toybox/WatchUi/WatchFace.html

    Create a Watch Face that supports exiting/entering low power mode.

    A WatchFace is a special View that provides notifications when the device changes power states.

    A WatchFace will run in a high power mode for a short period when responding to a gesture (i.e., raising the watch to check the time) or when returning to the watch face from another application. While in high power mode, the watch face will perform full screen updates every second via calls to onUpdate(), and the application will have access to timers and animations.

    After this period in high power mode (typically about ten seconds), the system will call onEnterSleep() to notify the application that it is preparing to enter low power mode.

    During low power mode the system will call onUpdate() at the top of every minute. If partial update support is available, the onPartialUpdate() method will be called for the first 59 seconds of every minute. The application will not have access to timers or animations while in low power mode.

    [https://forums.garmin.com/developer/connect-iq/f/discussion/5156/1hz-watch-faces---q-a]

    Correct me if I'm wrong, but maybe you're thinking of low-power mode + AOD (always on display) on OLED watches. In this case, it may not be feasible to have a seconds hand:

    [https://developer.garmin.com/connect-iq/connect-iq-faq/how-do-i-make-a-watch-face-for-amoled-products/]

  • Yes, it moves Slight smile And yes, if it didn't have a second hand in low power mode at all, then it would use even less power, if that's what you're hinting at. But that would be too easy Slight smile

    Garmin does allow screen updates every second, even in low power mode (at least on newer devices), but with a "power budget", which must not be exceeded. So the challenge was to continue drawing the second hand in low power mode, and staying within these execution time limits. My second hand is long and quite bulky, it initially juuust worked on 260x260 displays, but not on larger ones (Fenix 6X and 7X), and the code required quite a bit of refactoring until it passed on the larger displays as well.

    As an aside, in the process I noticed that

    • The execution time of your own watchface code is only a small portion of the total execution time (20-25% in my case). So optimizing that alone has limited potential.
    • The bulk of the time is spent as what the diagnostics tool of the simulator calls "Display Time". Interestingly, that seems to be relative to the vertical height of the objects drawn. For example, when my second hand is horizontal, the "Display Time" shown in the simulator tool is only about 7700, but when it is vertical, that number is almost 29000 (while the clipping region is the same rectangle in both cases, only horizontal or upright, respectively). So since my second hand is quite long, clipping it's tail a bit actually would have been the quickest way to fix the issue.

    The always on mode of AMOLED devices is a completely different story. My watchface works fine on such devices but fails miserably in always on mode; I haven't looked into that at all.