Android includes Contacts Provider
APIs to allow applications to manage contact information stored on the device. Contact data that is entered directly into the device is typically synchronized with a web service, but the data MAY also only reside locally on the device. Contacts that are only stored on the device are referred to as local contacts.
RawContacts are “associated with” or “stored in” an Account when the ACCOUNT_NAME
, and ACCOUNT_TYPE
, columns for the raw contacts match the corresponding Account.name and Account.type fields of the account.
Default local account: an account for raw contacts that are only stored on the device and not associated with an Account in the AccountManager, which are created with null values for the ACCOUNT_NAME
, and ACCOUNT_TYPE
, columns.
Custom local account: an account for raw contacts that are only stored on the device and not associated with an Account in the AccountManager, which are created with at least one non-null value for the ACCOUNT_NAME
, and ACCOUNT_TYPE
, columns.
Device implementations:
If device implementations use a custom local account:
ACCOUNT_NAME
, of the custom local account MUST be returned by ContactsContract.RawContacts.getLocalAccountName
ACCOUNT_TYPE
, of the custom local account MUST be returned by ContactsContract.RawContacts.getLocalAccountType
ACCOUNT_NAME
and ACCOUNT_TYPE
) MUST be inserted to the custom local account.CALLER_IS_SYNCADAPTER
param was set to true), even if the CALLER\_IS\_SYNCADAPTER
param was set to false or not specified.