Amazon Developer

as

Settings
Sign out
Notifications
Alexa
Amazon Appstore
Ring
AWS
Documentation
Support
Contact Us
My Cases
Get Started
Design and Develop
Publish
Reference
Support
Native
Skip to main content

Interface IPhoneBookClientDevice

interface IPhoneBookClientDevice
Extends com.amazon.apmf.IStandard

Methods

addListener()

com.amazon.apmf.ISubscription* addListener(IPhoneBookClientDeviceListener* listener)
Subscribe to phonebook client device events that are triggered by the remote device. A call to IPhoneBookClientDevice::connect() or IPhoneBookClientDevice::disconnect() does NOT trigger events in this listener. This listener is for receiving events related to connections and pull response triggered by the remote device and other applications only. Bluetooth phonebook client profile is not a listening service for connections. There can’t be incoming connection request from the remote device. Privilege: com.amazon.bluetooth.privilege.access

Parameters

listener
IPhoneBookClientDeviceListener* — Required For receiving phonebook client incoming connection events OR connections triggered by other applications, see IPhoneBookClientListener.

Returns

com.amazon.apmf.ISubscription* Returns ISubscription. The client can use the unsubscribe() to remove the listener.

connect()

void connect()
Connect to a device with the Phonebook Client profile. This is a blocking call. This triggers an outgoing connection. This device is the Phonebook client equipment and the remote device is the Phonebook server equipment. The device that is connected is the same device that is passed into IPhoneBookClient::getOrMakePhoneBookClientDevice() when creating this IPhoneBookClientDevice interface. If the device is already connected, this function returns without exception.

Throws

Privilege: com.amazon.bluetooth.privilege.phonebook_client

disconnect()

void disconnect()
Disconnect a device from the Phonebook client profile. This is a blocking call. The device from IPhoneBookClientDevice is the the device that gets disconnected. Privilege: com.amazon.bluetooth.privilege.phonebook_client

Throws


isConnected()

bool isConnected()
Get Phonebook client profile connection state. Privlege: com.amazon.bluetooth.privilege.access

Returns

bool Returns True if connected, False otherwise.

getPhoneBook()

PhoneBookContactCard*[] getPhoneBook(PhoneBookFolder* folder)
Send a request to get phonebook from the remote device. This is blocking call. This method pulls the phonebook entries from remote device and then forms PhoneBookContactCard data object list. The ownership of the PhoneBookContactCard list is transferred to client up on the return of this method. Privilege: com.amazon.bluetooth.privilege.phonebook_client

Parameters

folder
PhoneBookFolder* — Required Phonebook folder PhoneBookFolder.

Returns

PhoneBookContactCard*[] Returns list of references to PhoneBookContactCard.

Throws

  • BluetoothBusy — if the pull request is already in progress.
  • BluetoothFail — if the phonebook is empty from the remote device. Clients are expected to notify the user to allow user consent for contacts on the phone Bluetooth settings. Also, if phonebook failed to fetch intermediately from the remote device. Clients are expected to retry again.
  • BluetoothMaxBuffer — if out of resource to allocate for phonebook entries on client’s process.
  • BluetoothNotConnected — if the request is made without a profile connection.

getPhoneBookSize()

i32 getPhoneBookSize(PhoneBookFolder* folder)
Get phonebook size of folder from the remote device. This is the blocking call, this method makes request to remote device to fetch the size of phonebook folder from the remote device. Privilege: com.amazon.bluetooth.privilege.phonebook_client

Parameters

folder
PhoneBookFolder* — Required Folder name to get size from PhoneBookFolder.

Returns

i32 Returns number of entires of the phonebook folder.

Throws


isPhoneBookModified()

bool isPhoneBookModified(PhoneBookFolder* folder)
Get the status of phonebook folder on remote device. Default return value of this method is True. This is the blocking call. This method makes request to remote device to fetch database and version information from remote device and compares against cached previous information to determine if the phonebook is modified on remote device. Privilege: com.amazon.bluetooth.privilege.phonebook_client

Parameters

folder
PhoneBookFolder* — Required Folder name to get the status from PhoneBookFolder.

Returns

bool Returns true if phonebook folder is modified on remote, else false.

Throws


getDevice()

IDevice* getDevice()
Retrieves the device interface corresponding to the Bluetooth device with the Phonebook client profile-level connection. Privilege: com.amazon.bluetooth.privilege.phonebook_client

Returns

IDevice* Returns pointer to IDevice.
Last modified on October 29, 2026