Skip to content

Phone Contacts

Use this component when you want to have access to the User's Phone Contact List. You will be able to use the Contacts List for various use cases, such as making and receiving phone calls.

IVI SDK relies on the Bluetooth Contacts Profile for accessing the phone's contacts while connected over Bluetooth to the head Unit

1. Dependencies

Open the build.gradle file for your project and add the following dependencies:

1
2
3
4
dependencies {
    //for querying phone contacts
    implementation "com.telenav.sdk.vivid:android-sdk-contacts:${sdk_version}" 
}

2. Get Contacts

Permissions

Set the permission in order to be able to get contacts.

Permissions

1
<uses-permission android:name="android.permission.READ_CONTACTS" />
1
2
3
4
5
6
val contactsAccess = ContactsDataAccess.Factory().createDataAccess(
    context.contentResolver,
    ContactsDataAccess.DataAccessType.BASE
)

val allContacts = contactsAccess.getAll()

3. Search Contacts

Permissions

Set the permissions in orfer to be able to search contacts.

Permissions

1
<uses-permission android:name="android.permission.READ_CONTACTS" />
1
2
3
4
5
6
val contactsAccess = ContactsDataAccess.Factory().createDataAccess(
    context.contentResolver,
    ContactsDataAccess.DataAccessType.BASE
)

val contact = contactsAccess.getAllByName("John Doe")

4. Add/Update Contacts

Info

Not yet implemented.