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 AssociationRequest | What to show the user in the system device chooser, built with AssociationRequest.Builder. |
class CompanionDevice | A device this app is associated with. |
class CompanionDevices | Companion-device association: the OS-managed relationship between this app and one particular accessory. |
enum CompanionProfile | What kind of thing is being associated. |
class DeviceFilter | Narrows what the system device chooser offers the user. |
interface PresenceListener | Told when an associated device comes into or goes out of range. |