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
|
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
|
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 remove