3.0 KiB
CLAUDE.md
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
What this is
A Garmin Connect IQ watch-app for padel, written in Monkey C. It is currently the default scaffold generated by the VS Code "Monkey C: New Project" command — a single view with a menu — and has not yet been customized beyond the template.
- App entry:
garmin_padelApp(set inmanifest.xmlviaentry="garmin_padelApp"). - Build target: a single product,
venu445mm(Venu 4, 45mm), withminApiLevel="6.0.2".
Build, run, and test
There is no shell-script build harness; this project is built and run through the Monkey C VS Code extension (Connect IQ SDK), driven from the command palette:
- Build / run in simulator:
Monkey C: Build for DevicethenMonkey C: Run App, or just pressF5(the simulator launchesconnectiq+monkeydo). - Edit build targets / products:
Monkey C: Edit ProductsorMonkey C: Set Products by Product Category. - Edit app attributes, permissions, languages: the corresponding
Monkey C: Edit ...palette commands. These regeneratemanifest.xml— do not hand-edit it (it is marked generated). - Package for the store:
Monkey C: Export Project(produces a.iqfile).
CLI equivalents (if the SDK bin is on PATH) use monkeyc to compile against a device + SDK, connectiq/monkeydo to run in the simulator, and monkeyc --unit-test (with a test runner view) for unit tests. There are currently no tests in this repo.
Code architecture
Connect IQ apps follow a fixed MVC-ish lifecycle. The four source/*.mc files map to the standard roles:
garmin-padelApp.mc—AppBasesubclass.getInitialView()returns the initial[View, InputDelegate]pair. App-wide start/stop hooks live here.getApp()is the global accessor.garmin-padelView.mc—WatchUi.View.onLayoutbindsRez.Layouts.MainLayout;onShow/onUpdate/onHideare the render/visibility lifecycle.garmin-padelDelegate.mc—BehaviorDelegatefor the main view.onMenu()pushes the menu (Rez.Menus.MainMenu) with its delegate.garmin-padelMenuDelegate.mc—MenuInputDelegate.onMenuItem(item as Symbol)dispatches on menu-item symbols (:item_1,:item_2).
Key conventions:
- Resources are referenced via the generated
Reznamespace (Rez.Layouts.*,Rez.Menus.*,Rez.Strings.*,Rez.Drawables.*). These symbols are generated at build time from the XML inresources/— you do not write them by hand. resources/holds the declarative UI and assets:layouts/layout.xml,menus/menu.xml,strings/strings.xml,drawables/. Menu item ids inmenu.xmlmust match the:symbolnames handled in the menu delegate, and string ids must match@Strings.*references.monkey.jungleis the build config; it currently only points atmanifest.xml. Per-device resource overrides and source paths would be added here.bin/is generated build output (.mir,.mbc,Rez.mcgen) — never edit; safe to delete and regenerate.