proomt

Search

Search posts, papers, and topics

All posts

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

Related reading

  1. Watch Apps: One Codebase, Two Real Applications

    Codename One now lets you build an Apple Watch or Wear OS companion app from a single codebase by specifying a watchMain class and optional watchStandalone flag. The new WearableConnection API offers putData, sendMessage, and transferFile primitives for asynchronous phone‑watch communication, with simulator support for both platforms.

    CodeName Onecodenameone.com4 min
  2. We Stopped Waiting for Platform Changes to Find Us

    Codename One added a daily automated scan of Apple and Google deprecation notices, linking each notice to concrete builder artifacts before work is created. The system caught the Android 16 back‑gesture change and enabled a permission‑free ContactPicker, turning policy shifts into repeatable, evidence‑backed patches.

    CodeName Onecodenameone.com3 min
  3. Tapjacking Protection: Rejecting Android Touches Behind an Overlay

    Codename One adds tapjacking protection to its Android runtime. It detects fully or partially obscured MotionEvents, offers four policies (OFF, REPORT, BLOCK, STRICT), can block the entire gesture, and on Android 12+ can request the system hide overlay windows. The API is exposed via `DeviceIntegrity.setTapjackingProtection` and a listener for state changes. iOS has no overlay threat, so the feat…

    CodeName Onecodenameone.com3 min
  4. SQLite Across Every Port: One Contract, One Encrypted File Format

    Codename One now ships a single, tested SQLite contract that works natively on Android, iOS, Windows, Linux, and in browsers via WebAssembly, with built‑in SQLCipher‑4 encryption supporting three key models. A conformance suite guarantees identical behavior across platforms, and migration helpers let legacy apps opt‑in. The update also adds a proper watch‑app model, DOM‑based text for JavaScript,…

    CodeName Onecodenameone.com11 min
  5. Native Drag and Drop Meets Cross-Device Continuity

    Codename One 8.0 adds two user‑experience primitives: **Cross‑Device Continuity** (state checkpointing + Apple Handoff + custom HTTP relay) and **Native Drag‑and‑Drop** (OS‑level drag using the same ClipboardContent model). The post shows the API (StateProvider, Continuity.checkpoint, NativeDragOperation), platform support tables, and practical advice on payload size, security, thread handling, a…

    CodeName Onecodenameone.com7 min
  6. App Intents: One Java Declaration for Siri, Spotlight, and Shortcuts

    Codename One adds @AppIntent annotations that let a static Java method be exposed as a Siri, Spotlight, or Android shortcut. The build‑time processor generates native declarations, a reflection‑free dispatch table, and validates the intent metadata. Handlers can be headless, accept typed parameters, return results, and be invoked internally via Intents.invoke(). Entities enable system‑driven disa…

    CodeName Onecodenameone.com5 min