java.lang.Object | |
↳ | com.neomades.contact.ContactDatabase |
This class allows to manage contacts in the phone's address book through
requests to the data layer.
To use this class, the WRITE_CONTACTS
, READ_CONTACTS
and
GET_ACCOUNTS
permissions must be declared in the URS file.
Get this object by calling the static method
getDefault()
.
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
void |
delete(Contact contact, ContactResultListener resultListener)
Deletes a given contact in the phone's address book.
| ||||||||||
void |
getAllContacts(ContactResultListener resultListener)
Returns all contacts from the phone's address book.
| ||||||||||
static ContactDatabase |
getDefault()
Returns the default instance of ContactDatabase.
| ||||||||||
void |
save(Contact contact, ContactResultListener resultListener)
Creates or updates a given contact in the phone's address book.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
Returns all contacts from the phone's address book. The contacts can be
accessed with a ContactResultListener
.
resultListener | callback to listen result of contacts |
---|
Returns the default instance of ContactDatabase.
SecurityException | if one of the three permissions to access contacts
(WRITE_CONTACTS , READ_CONTACTS or
GET_ACCOUNTS ) is missing.
|
---|
Creates or updates a given contact in the phone's address book.
Set the contact's ID with setId(int)
method for update an
existing contact (or use
pickSingleContact(ContactResultListener)
to select
it).