Series 80 Phonebook

Login to reply to this topic.
Thu, 2006-03-02 16:31
Joined: 2006-01-09
Forum posts: 105
Hi Developers !!

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


Code:
_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

Thanks and Regards
CodePupil
__________________________
You are I and I am he .. !!


Mon, 2006-04-24 07:49
Joined: 2006-04-21
Forum posts: 2
Re: Series 80 Phonebook
Maybe you have miss these two phrases after CleanupStack::Pop();

contactsDb->AddNewContactL(*contact);
contactsDb->SetOwnCardL(*contact);

  • Login to reply to this topic.