blog
Ottorino Bruni  

Getting Started with Garmin Connect IQ Development: Build Your First Watch Face with Monkey C and VS Code

Introduction

As a seasoned software developer focused on cloud applications, I’ve always harbored a passion for gadgets and mobile devices. My journey in mobile development started in the early days, crafting applications for Nokia phones using J2ME, and later evolved to iOS development since the first iPhone release.

My Smartwatch Journey Being deeply embedded in the Apple ecosystem, I’ve owned every Apple Watch generation from the original to the Ultra 2. However, after years of daily charging routines, one crucial factor began to nag at me: battery life. While modern smartwatches from competitors routinely offer week-long battery life, even the latest Apple Watch struggles to surpass two days of use.

The Switch to Garmin This battery limitation led me to explore alternatives that would still maintain good iPhone compatibility. As someone with a particular fondness for Casio G-Shock’s rugged aesthetic, the new Garmin Instinct 3 Solar caught my attention. Since making the switch, I haven’t looked back – the combination of durability, extensive battery life, and robust features has proven to be exactly what I was looking for. (Stay tuned for a detailed review of the device in a future article!)

From User to Developer True to my developer nature, I couldn’t resist diving into the development possibilities for my new device. Garmin’s Connect IQ platform offers an exciting opportunity to create custom watch faces and applications. In this tutorial, I’ll guide you through creating your first watch face specifically for the Garmin Instinct 3, breaking down each step to make it accessible even for those new to Garmin development.

What We’ll Cover Through this guide, you’ll learn how to:

  • Deploy your watch face to your device
  • Set up your development environment with VS Code
  • Work with Monkey C, Garmin’s programming language
  • Create a custom watch face for the Instinct 3
  • Test your creation in the simulator

Understanding Connect IQ: Garmin’s Development Platform

Connect IQ is Garmin’s powerful development platform that enables developers to create custom applications, watch faces, widgets, and data fields for compatible Garmin devices. Think of it as the “App Store ecosystem” for Garmin devices.

Key Components of Connect IQ:

  • Monkey C: A proprietary programming language similar to Java/C++
  • Connect IQ SDK: Development toolkit and simulator
  • Visual Studio Code Extension: Official development environment
  • Companion Mobile App: For testing and installation

Types of Connect IQ Applications:

  1. Watch Faces: Custom time displays with complications
  2. Widget Apps: Glanceable information displays
  3. Data Fields: Custom metrics for activity recording
  4. Background Services: Apps running without UI
  5. Full Applications: Feature-complete programs

Development Capabilities:

  • Access to device sensors (heart rate, GPS, etc.)
  • Custom UI elements and layouts
  • Background processing
  • Data storage and retrieval
  • Bluetooth connectivity
  • Web API integration

Device Compatibility: Each Garmin device has specific:

  • Memory limitations
  • Screen resolution
  • Available sensors
  • Supported features

Resource Management:

  • Limited device memory
  • Battery optimization requirements
  • Storage constraints
  • Processing power considerations

Understanding these fundamentals is crucial before we dive into creating our first watch face. The platform offers significant possibilities while requiring careful consideration of device limitations and resource management.

Example: Getting Started with Garmin Development Environment on macOS

Disclaimer: This example is purely for educational purposes. There are better ways to write code and applications that can optimize this example. Use this as a starting point for learning, but always strive to follow best practices and improve your implementation.

Prerequisites

Before starting, make sure you have the following installed:

Quick Guide: Setting Up Connect IQ SDK Manager

Download and Installation:

  1. Visit developer.garmin.com/connect-iq/sdk
  2. Click “Accept & Download” in SDK Manager section
  3. Create new folder for installation
  4. For Mac: Drag SDK Manager from disk image to your folder

Initial Setup:

  1. Launch SDK Manager
  2. Log in with Garmin Connect account
  3. Choose credential storage preference
  4. Configure update preferences:
    • Automatic SDK updates or manual notifications
    • Device updates settings

Main Features:

  • SDK Tab:
    • Download/install SDKs
    • Uninstall old versions
    • Set active SDK version
  • Devices Tab:
    • Download device support
    • Update existing devices
    • Remove unused devices
Getting Started with Garmin Connect IQ Development – Garmin Connect IQ

Monkey C Extension for VS Code

The official Garmin extension transforms VS Code into a complete Connect IQ development environment. It adds essential features like code highlighting, build integration, and debugging tools. You’ll need VS Code, Java Runtime 8 or higher, and Connect IQ SDK 4.0.6+ installed. Once set up, you can write, test, and deploy Garmin applications directly from your editor.

Getting Started with Garmin Connect IQ Development – Monkey C Extension

Creating Your Developer Key for Garmin Connect IQ

Every Garmin app requires signing with a private RSA 4096-bit key. This key is crucial as you’ll need to maintain it safely – losing it means you won’t be able to update your apps in the future.

Generate Key Using VS Code

Follow these simple steps:

  1. Open VS Code Command Palette:
  • Mac: Press Command + Shift + P
  • Windows/Linux: Press Ctrl + Shift + P

Key Storage Best Practices:

  • Create a dedicated secure folder (e.g., ~/Development/garmin-keys/)
  • Use meaningful naming (e.g., garmin_developer_key.pem)
  • Back up your key securely
  • Never share your private key

Creating Your First Garmin Watch Face

Open VS Code and bring up the Command Palette (Command + Shift + P on Mac). Type “Monkey C” and select “Create New Project” from the available options. This launches the project creation wizard that will guide you through setting up your watch face project.

The wizard will first ask you to select a project type. Choose “Watch Face” since we’re creating a custom time display. Next, you’ll need to pick your target devices – in our case, select “Instinct 3” from the device list. You can also select additional compatible devices if you want your watch face to work across multiple Garmin models.

For the API version, it’s generally recommended to choose the latest stable version supported by your target device. However, if you need broader device compatibility, you might want to select an earlier version. The wizard will automatically suggest compatible API versions for your selected devices.

Finally, choose a location for your project and give it a meaningful name. The extension will generate a basic project structure with all necessary files, including the manifest, resources folder, and a basic watch face implementation.

Getting Started with Garmin Connect IQ Development – WatchFace Code

Testing and Deploying Your Watch Face

Quick Testing with Simulator Hit the play button in VS Code’s toolbar to launch your watch face in the simulator. Select “Instinct 3” (or your target device) from the simulator options. The simulator provides a realistic preview of how your watch face will look and behave on an actual device, including features like different time formats, backlight conditions, and even low battery states.

Building for Your Device When you’re satisfied with the simulator preview, it’s time to deploy to your actual watch:

  1. Open Command Palette (Command + Shift + P)
  2. Select “Monkey C: Build for Device”
  3. Choose your target device (Instinct 3)
  4. VS Code will generate a BasicWatchFace.prg file in your project’s bin folder

Installing on Your Watch Simply connect your Garmin device to your Mac via USB. It will appear as an external drive. Navigate to the GARMIN/APPS directory and copy your .prg file there. Your watch face will be available after disconnecting the device.

Getting Started with Garmin Connect IQ Development – Testing and Deploying Your Watch Face

If you think your friends or network would find this article useful, please consider sharing it with them. Your support is greatly appreciated.

Thanks for reading!

🚀 Discover CodeSwissKnife, your all-in-one, offline toolkit for developers!

Click to explore CodeSwissKnife 👉

Leave A Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.