Samsung Electronics logo

Exporting Contacts

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

  1. Retrieve the default system address book using the getDefaultAddressBook() method of the ContactManager interface and find all contacts with "Chris" in the first name:

    var addressbook;
    var addressbook =;
    /* Define a filter */
    var filter = new webapis.AttributeFilter("name.firstName", "CONTAINS", "Chris");
    /* Search for the contacts */
    addressbook.find(contactsFoundCB, errorCB, filter);
  2. Convert a contact to a vCard string in the success event handler of the find() method.

    In the following example, the first found contact is exported by converting it to the vCard version 3.0 format.

    function contactsFoundCB(contacts) 
       /* Convert the first contact */
       var vcard = contacts[0].convertToString("VCARD_30");
       console.log("textual representation of the contact is: " + vcard);