package com.codename1.nearby.companion

Companion-device association: telling the operating system which accessory is yours, and getting privileges back for it.

Start at CompanionDevices, which explains what association buys that an ordinary Bluetooth scan does not – OS-run presence watching, scanning without location permission, and one honest consent prompt naming one device.

An association is a durable relationship: it survives app restarts and reboots, and ends only when the app drops it, the user revokes it in system settings, or the app is uninstalled. Persist CompanionDevice.getId() and look the device up again on the next launch instead of asking the user to pick it twice.

Types

class AssociationRequestWhat to show the user in the system device chooser, built with AssociationRequest.Builder.
class CompanionDeviceA device this app is associated with.
class CompanionDevicesCompanion-device association: the OS-managed relationship between this app and one particular accessory.
enum CompanionProfileWhat kind of thing is being associated.
class DeviceFilterNarrows what the system device chooser offers the user.
interface PresenceListenerTold when an associated device comes into or goes out of range.