addContact

suspend fun addContact(    prefix: String = "",     firstName: String,     middleName: String = "",     lastName: String,     suffix: String = "",     asFavorite: Boolean = false,     typedPhoneNumbers: List<TypedPhoneNumber>,     photo: Bitmap?,     companyName: String?,     addresses: List<TypedAddress>?)

Add a single contact with a name, contact details and a photo. Each TypedPhoneNumber is a pair value (phone number, phone type) with a none blank phone number.

See also

android.provider.ContactsContract.CommonDataKinds.Phone

for the list of phone type.

Parameters

prefix

Prefix of the contact name, the default value is an empty string.

asFavorite

Set to true for favorite contact, by default the contact is not a favorite.

firstName

Contact's first name, should not be blank and can contain whitespaces.

lastName

Contact's last name, should not be blank and can contain whitespaces.

suffix

Suffix of the contact name, the default value is an empty string.

typedPhoneNumbers

List of the contact phone numbers. Should not be empty.

photo

The contact photo. If null no photo is assigned to the contact.

companyName

If null, no company name is added to the contact.

addresses

List of addresses for this contact, if null, no address is added.