Export contact to vCard

This code shows how to export contact from address book to vCard format.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
var addressbook;
var addressbook = tizen.contact.getDefaultAddressBook();
/* Define a filter */
var filter = new tizen.AttributeFilter("name.firstName", "CONTAINS", "Test");
/* Success callback */
function contactsFoundCB(contacts) 
{
    /* Convert the first contact */
    var vcard = contacts[0].convertToString("VCARD_30");
    console.log(vcard);
}
/* Error callback */
function errocCb(error) {
    console.log(JSON.stringify(error));
}
    
/* Search for the contacts */
addressbook.find(contactsFoundCB, errocCb);
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX