CodeName OneShai Almog5 min readintermediate
UWB and Nearby Devices: Distance, Direction, Association, and Transport
Summary
Codename One introduces three new packages—ranging, companion, and transport—to expose UWB distance/direction, user‑approved device association, and local payload exchange on Android and iOS. The APIs require capability checks, BLE token handshakes, and handle platform limits such as missing cross‑ecosystem transport.
- Three packages—ranging, companion, transport—are split by capability and gated by `isSupported()` checks.
- UWB ranging starts after exchanging a BLE token; distance and direction fields are optional and may disappear at range edges.
- Companion association uses the OS chooser to obtain a durable device ID; Android provides presence events, iOS does not.
- NearbyTransport maps to Google Nearby Connections on Android and MultipeerConnectivity on iOS; cross‑platform payloads require BLE L2CAP or sockets.
Mobile developers building cross‑platform apps need a clear, safe way to use UWB, device association, and nearby data transfer without hidden platform traps.
6/10