# 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 Type
  Method
  Description
  `void`
  `deviceAppeared(CompanionDevice device)`
  The associated device came into range.
  `void`
  `deviceDisappeared(CompanionDevice device)`
  The associated device went out of range.

- ## Method Details

  - ### deviceAppeared

    void deviceAppeared(CompanionDevice device)

    The associated device came into range.

    ###### Parameters

    - `device`: the device that appeared

  - ### deviceDisappeared

    void deviceDisappeared(CompanionDevice device)

    The associated device went out of range.

    ###### Parameters

    - `device`: the device that disappeared