Read-only archive of the All About Symbian forum (2001–2013) · About this archive

Series 80 phonebook

0 replies · 2,213 views · Started 02 March 2006

Hi Developers !!

i'm facing problem regarding phonebook.
i've to save contacts in phonebook for which i'm using following code snippet..

_LIT(KSurnameLabel,"Surname"😉;
_LIT(KSurname,"Wilkinson"😉;

// Open the default contacts database:

CContactDatabase* contactsDb = CContactDatabase::OpenL();

CleanupStack::PushL(contactsDb);

// Create a contact card and add some fields:

CContactItem* contact = CContactCard::NewLC();

CContactItemField* field = CContactItemField::NewLC(KStorageTypeText, KUidContactFieldFamilyName);

field->SetMapping(KUidContactFieldVCardMapUnusedN);

field->SetLabelL(KSurnameLabel);

field->TextStorage()->SetTextL(KSurname);

contact->AddFieldL(*field);

CleanupStack::Pop();

This code compiles and runs well but when i check the emulator's phonebook...no contact is there...

why it is so?

am i missing something?

plz throw some light on it ..............

any help would be greatly appreciated !!!!

Best Regards
CodePupil