Search code examples
c++mobilesymbians60

Reading SIM contacts on Symbian S60


I am looking for a working code snippet for Symbian S60 5th edition in which you can read SIM contact details.

If possible, I would skip using RPhoneBookSession, but if that is the only way, please provide code snippet how to use it.

Thank you.


Solution

  • What you want is the example code from the relevant chapter of the Quick recipes on Symbian OS book, which you can find here.

    EDIT-1:

    Should have read the question more carefully.

    The CContactDatabase API should synchronize with the SIM Phonebook seamlessly by using RPhoneBookSession so you don't have to.

    To figure out what's wrong, I would suggest calling RPhoneBookSession::GetLastSyncError, RPhoneBookSession::GetPhoneBookCacheState and RPhoneBookSession::GetSyncMode.

    I would also suggest doing all this both before and after adding a new CContactICCEntry to the database yourself.

    Of course, this is all supposing Nokia didn't just brutally disable Phonebook synchronization...

    EDIT-2:

    If Nokia disabled Symbian's phonebook synchronization, they may have replaced it with their own, which would mean that using the CPbkContactEngine::AllContactsView method could yield different results than the CContactDatabase approach.

    Let's face it, though. If the Contacts application provided with the phone doesn't even allow you to save a contact on the SIM, Nokia may have removed all possibilities to interact with the SIM phonebook period.

    EDIT-3:

    You could try to develop against phbksyncsvr.lib using the binaries in the Product Development Kit (PDK) from the first real version of the Symbian Foundation operating system: Symbian^2. Binary compatibilty between versions of Symbian OS can sometimes help you.