CodeName OneShai Almog5 min readintermediate
Watch Follow-Through: Complications, Tiles, and a Companion Wear APK
Summary
Codename One 6.5 adds full watch‑face support: surface declarations now generate Apple Watch WidgetKit extensions and Wear OS complication data sources plus ProtoLayout Tiles. A phone‑side `Surfaces.publish()` mirrors descriptors to the watch via WatchConnectivity/Data Layer. Android builds now emit both a phone APK and a Wear‑only APK (or a standalone watch APK). WatchOS build failures were fixe…
- Declare watch families (`WATCH_CIRCULAR`, `WATCH_RECTANGULAR`, etc.) in `WidgetKind` and they automatically produce platform‑specific extensions.
- Apple gets a `CN1WatchWidgets` WidgetKit extension; Wear OS gets a complication data source per kind and a ProtoLayout Tile for rectangular families.
- Phone‑side `Surfaces.publish()` now mirrors the surface descriptor and imagery to the watch; this is best‑effort and limited to 48 KB payload on iOS.
- Android builds now output `myapp.apk` and `myapp-wear.apk` (or a single standalone watch APK with `codename1.watchStandalone=true`). Version code offsets let Play serve the correct binary.
Cross‑platform watch support has been a long‑standing gap for Codename One. By generating native adapters and handling data mirroring, developers can now ship a single codebase that delivers functional complications and Tiles on both Apple Watch and Wear OS, reducing the need for separate native mo…
6/10