Contacts

From Pointui

This is a Global object. You must not create an instance of it as one is always available for your use.

Provides access to contacts. NOTE: this is a global object so an instance is always available to use – you do not need to ever create additional instances.

Contents

Methods

void GetContacts(DataTable result)

Returns the entire list of contacts on the device.

EXAMPLE

DataTable contacts;
Contacts.GetContacts(contacts);
while (contacts.MoveNext())
{
	//do something with contacts
}

void Display(int objectID)

Displays the default OS screen for a specific contact. Each contact has a unique id which can be retrieved using DataTable.GetValue(“ObjectID”).

PARAMETERS

  • objectID – the unique ID of the contact object.

EXAMPLE

//get contacts
DataTable contacts;
Contacts.GetContacts(contacts);
 
//move to first contact
contacts.MoveNext();
 
//get the unique id for the contact
int oid;
contacts.GetValue(“ObjectID”, oid);
 
//display the OS screen for this contact
Contacts.Display(oid);

void DisplayCard(int objectID)

* NOT AVAILABLE IN FREE VERSION OF HOME Similar to Display(), but displays the Pointui Home version of a contact card.

void DisplayUnknownCallerScreen(String phoneNumber)

Displays the Home screen that provides options to handle an unknown caller such as save the phone number to an existing contact, or create a new contact.

PARAMETERS

  • phoneNumber – must be a valid phone number that can be dialed.

void DisplayApp()

Displays the default OS contacts application.

void Create(Contact result)

Creates a new contact with no properties set, not even a name or unique ObjectID. Before an ObjectID property value can be retrieved the resulting Contact object must have it’s Save() method called. Also, other methods such as Display() may fail on the resulting Contact object if called before Save().

EXAMPLE

//create a new contact
Contact contact;
Contacts.Create(contact);
 
contact.SetValue(“FirstName”, “Jack”);
contact.Save();
 
//show the contact
contact.Display();

bool FindNearest(String lookFor, String lookWithin, Contact result)

Searches for a contact that is the closest match to the supplied criteria, and returns it in the result parameter. See Microsoft documentation for definition of “closest match”.

PARAMETERS

  • lookFor – the string to try and find within a contact
  • lookWithin – must be a comma separated list of one or more of the following:
    • “FileAs”
    • “Phone”
    • “Email”
    • “All” – look in all of the above.

EXAMPLE

Contact contact;
Contacts.FindNearest(“info@pointui.com”, “Email”, contact);

void GetCategories(DataTable result)

AVAILABLE SINCE: 2.1 Fills the result DataTable with the list of contact categories.