View Full Version : Series 80 phonebook


CodePupil
02-03-2006, 03:39 PM
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