Interface PresenceListener
public interface PresenceListener
Told when an associated device comes into or goes out of range. Both methods are called on the EDT.
Presence is the reason companion association is worth using for an accessory the app talks to regularly: the OS watches for the device and wakes the app, instead of the app burning battery on a scan it runs itself.
-
Method Summary
Modifier and TypeMethodDescriptionvoiddeviceAppeared(CompanionDevice device) The associated device came into range.voiddeviceDisappeared(CompanionDevice device) The associated device went out of range.
-
Method Details
-
deviceAppeared
The associated device came into range.
Parameters
device: the device that appeared
-
deviceDisappeared
The associated device went out of range.
Parameters
device: the device that disappeared
-