With Safari, you learn the way you learn best. Get unlimited access to videos, live online training,
learning paths, books, tutorials, and more.

No matter what kind of device a person owns (iOS, Android, BlackBerry, Palm webOS, and so on), it is bound to have a Contacts database built in to it. The Contacts database contains all the contacts that a person stores on the phone — friends, family, business colleagues, and others — but that isn’t a guarantee that every phone manufacturer will follow a standard when it comes to the contact fields it stores and retrieves.

That being said, the PhoneGap Contacts API does a remarkably good job of letting users create, update, and find contacts, all of which you learn about in this chapter.

LEARNING ABOUT CREATING CONTACTS

The easiest way to learn how to use the Contacts API is to create a contact. You create a contact with the contacts.create() method, like this:

var myContact = navigator.contacts.create(properties);

When you use this method, it creates a new Contact object that you can then manipulate.