方法有两个:
1 确定出他们的路径,用文件的方式读;
2 用系统给这两个部分提供的API
通讯录方面的(别人的代码网上找的):
_LIT(KNameLabel,"Name");
_LIT(KMobileLabel,"Mobile");
_LIT(KName,"Steve");
_LIT(KMobile,"+8613900000000");
// 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(KNameLabel);
field->TextStorage()->SetTextL(KName);
contact->AddFieldL(*field);
CleanupStack::Pop();
field = CContactItemField::NewLC(KStorageTypeText, KUidContactFieldPhoneNumber);
field->SetMapping(KUidContactFieldVCardMapTEL);
field->SetLabelL(KMobileLabel);
field->TextStorage()->SetTextL(KMobile);
contact->AddFieldL(*field);
CleanupStack::Pop();
// Add the new contact to the database and set it as the own card:
contactsDb->AddNewContactL(*contact);
contactsDb->SetOwnCardL(*contact);
CleanupStack::PopAndDestroy(2); // contact contactsDb
短信的:
CMsvEntry或 CMsvServerEntry