Samsung Electronics logo

Importing Contacts

To create engaging applications with various contacts features, you must learn to import contacts with the help of the vCard format:

  1. Retrieve the default system address book using the getDefaultAddressBook() method of the ContactManager interface:

    var addressbook =;
  2. Create a new Contact object from the vCard string and add it to the default address book:

    var contact = null;
       contact = new webapis.Contact("BEGIN:VCARD\n"+
                                   "FN:Forrest Gump\n"+
                                   "ORG:Bubba Gump Shrimp Co.\n"+
                                   "TITLE:Shrimp Man\n"+
                                   "TEL;WORK:(111) 555-1212\n"+
                                   "TEL;HOME:(404) 555-1212\n"+
          console.log("Contact was added with ID " +;

To convert multiple strings and import them to an address book, convert the strings one by one and then use the addBatch() method of the AddressBook interface to add all the contacts at once in the batch mode.