This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
gimporter is a Garmin ConnectIQ application written in MonkeyC that downloads GPX/FIT files from a companion Android app (gexporter) and imports them as courses on Garmin devices. Part of a larger gimporter/gexporter ecosystem.
make build # Build for default device (set DEVICE in properties.mk)
make buildall # Build for all supported devices
make run # Build and run in simulator
make test # Run tests in simulator
make deploy # Deploy to connected device
make package # Create distribution .iq files (app + widget)
make clean # Remove build artifactsBuild for a specific device: make build DEVICE=fenix7
Edit properties.mk to configure:
DEVICE: Target device (default: marqadventurer)SDK_HOME: ConnectIQ SDK path (auto-detected from~/Library/Application Support/Garmin/ConnectIQ/current-sdk.cfg)PRIVATE_KEY: Path to signing key (.der file)DEPLOY: Device mount point for deployment
-
gimporterApp.mc: Main application containing:
gimporterApp: App class handling HTTP communication, course downloads, and PersistedContent importsgimporterView/gimporterDelegate: Main view and input handlingPortRequestListener: Handles Android companion app communicationSimilarCourseChooser/SimilarCourseChooserDelegate: Menu for selecting from similar course matches
-
TrackChooser.mc: Paginated track list UI (15 items per page with "MORE" option)
- App checks Bluetooth connection (WiFi must be off)
- Requests port from Android companion app via
Comm.transmit(["GET_PORT"], ...) - Fetches track list from
http://127.0.0.1:[port]/dir.json - Downloads selected track as GPX or FIT (device-dependent, set via
Rez.Strings.GPXorFIT) - Imports via
PersistedContentAPI, searches for matching course in courses/tracks/routes - If exact match found, launches course; if similar matches found, presents selection menu
The build uses split jungle include files:
monkey-base.jungleinc: Per-device resource paths (launcher icons, FIT/GPX support)monkey-app.jungleinc: App manifest referencemonkey-widget.jungleinc: Widget manifest reference
Resources are organized by:
resources-fit/vsresources-nofit/: Device FIT file support capabilityresources-launcher-NxN/: Device-specific icon sizesresources-round-NxN/,resources-rectangle-NxN/,resources-semiround-NxN/: Screen shape layouts
- Course name normalization strips
_course.fit,.fit,.gpxsuffixes for matching - Port request has 1-second timeout before falling back to default port 22222
- Track pagination: 15 items per page, uses Symbol identifiers
:ITEM_0through:ITEM_15 - App exists in two variants: watch-app and widget (widget manifest auto-generated from app manifest)