public class ContactsManager extends Object
Constructor and Description |
---|
ContactsManager() |
Modifier and Type | Method and Description |
---|---|
static String |
createContact(String firstName,
String familyName,
String workPhone,
String homePhone,
String mobilePhone,
String email)
Create a contact to the device contacts book
|
static boolean |
deleteContact(String id)
removed a contact from the device contacts book
|
static String[] |
getAllContacts()
This method returns all contacts IDs
|
Contact[] |
getAllContacts(boolean withNumbers,
boolean includesFullName,
boolean includesPicture,
boolean includesNumbers,
boolean includesEmail,
boolean includeAddress)
Notice: this method might be very slow and should be invoked on a separate thread!
It might have platform specific optimizations over getAllContacts followed by looping
over individual contacts but that isn't guaranteed.
|
static String[] |
getAllContactsWithNumbers()
This method returns all contacts that has a phone number
|
static Contact |
getContactById(String id)
This method returns a Contact by the contact id
|
static Contact |
getContactById(String id,
boolean includesFullName,
boolean includesPicture,
boolean includesNumbers,
boolean includesEmail,
boolean includeAddress)
This method returns a Contact by the contact id and fills it's data
according to the given flags
|
boolean |
isGetAllContactsFast()
Indicates if the getAllContacts is platform optimized, notice that the method
might still take seconds or more to run so you should still use a separate thread!
|
public static String[] getAllContacts()
public static String[] getAllContactsWithNumbers()
public static Contact getContactById(String id)
id
- of the Contactpublic static Contact getContactById(String id, boolean includesFullName, boolean includesPicture, boolean includesNumbers, boolean includesEmail, boolean includeAddress)
id
- of the ContactincludesFullName
- if true try to fetch the full name of the Contact(not just display name)includesPicture
- if true try to fetch the Contact Picture if existsincludesNumbers
- if true try to fetch all Contact numbersincludesEmail
- if ture try to fetch all Contact EmailsincludeAddress
- if ture try to fetch all Contact Addressespublic static String createContact(String firstName, String familyName, String workPhone, String homePhone, String mobilePhone, String email)
firstName
- the Contact firstNamefamilyName
- the Contact familyNameworkPhone
- the Contact work phone or nullhomePhone
- the Contact home phone or nullmobilePhone
- the Contact mobile phone or nullemail
- the Contact email or nullpublic static boolean deleteContact(String id)
id
- the contact id to removepublic Contact[] getAllContacts(boolean withNumbers, boolean includesFullName, boolean includesPicture, boolean includesNumbers, boolean includesEmail, boolean includeAddress)
withNumbers
- if true returns only contacts that has a numberincludesFullName
- if true try to fetch the full name of the Contact(not just display name)includesPicture
- if true try to fetch the Contact Picture if existsincludesNumbers
- if true try to fetch all Contact numbersincludesEmail
- if true try to fetch all Contact EmailsincludeAddress
- if true try to fetch all Contact Addressespublic boolean isGetAllContactsFast()