×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Regular Contributor
    Join Date
    Apr 2006
    Location
    India
    Posts
    383

    Question ImportContactsL Issues

    Hi All Experts!

    We are importing the VCard using ImportContactsL of CContactDatabase.
    The code is as follows:

    // Open the default contact database
    CContactDatabase* contactsDb = CContactDatabase::OpenL();
    CleanupStack::PushL(contactsDb);

    TBool iSuccessfulImport= EFalse;
    TUid p1;
    p1.iUid = KVersitEntityUidVCard;

    CArrayPtr<CContactItem>* imported = contactsDb->
    ImportContactsL(p1,iReadStream,iSuccessfulImport,CContactDatabase::ETTFormat);
    CleanupStack::PopAndDestroy(); // contactsDb
    The code works fine on 3650 n the contacts are getting imported successfully.

    But if I try to execute the code on 6600 ImportContactsL(--) leaves with KErrNotFound(-1)
    iSuccessfulImport is set to ETrue i.e at least one contact is successfully imported.

    After all this , it seems to lock the contact database. If I open my phone book, no contact can be seen untill I reset the device.

    I have tried possible combinations of TOptions and iReadStream is ok too.

    I am not getting the reason to leave ImportContactsL with KErrNotFound :-(

    Experts plz guide.

    Thanks
    Regards,
    Shilpa Kulkarni

  2. #2
    Super Contributor
    Join Date
    Jul 2004
    Location
    Romania
    Posts
    560

    Re: ImportContactsL Issues

    VCard parser can be a different one on your 6600. Can you show what vCard are you trying to import?

  3. #3
    Regular Contributor
    Join Date
    Apr 2006
    Location
    India
    Posts
    383

    Re: ImportContactsL Issues

    Hi pirosl!
    Thanks for the reply.

    Well, we have tried different options to get it done.

    After checking the thread http://discussion.forum.nokia.com/fo...t=CBCardEngine

    I exported the data using CBCardEngine successfully.

    The exported data is of format:
    PHP Code:
    BEGIN:VCARD.
    VERSION:2.1.
    N:;S.
    TEL;Cell:9820098200.
    END
    :VCARD
    Then I tried to import it using the code:
    RFs fs;
    RFile file;
    User::LeaveIfError(fs.Connect());
    User::LeaveIfError(file.Open(fs, _L("C:\\TextData.txt"), EFileRead));
    RFileReadStream inputFileStream(file);

    CPbkContactEngine* iPbkContactEngine = CPbkContactEngine::NewL();
    CBCardEngine* iBCardEngine = CBCardEngine::NewL(iPbkContactEngine);

    HBufC8* importedData = HBufC8::NewL(1024);
    while(ETrue)
    {
    importedData->Des().Zero();
    TRAPD(iReadErr,inputFileStream.ReadL(importedData->Des(), (TChar)'\r\n'));
    CPbkContactItem* iEmptyContactItem =
    iPbkContactEngine->CreateEmptyContactL();

    TRAPD(iErr,iBCardEngine->ImportBusinessCardL(*iEmptyContactItem,inputFileStream));
    TRAPD(iErCommit,iPbkContactEngine->CommitContactL
    (*iEmptyContactItem));//***

    delete iEmptyContactItem;

    if(iReadErr == KErrEof)
    {
    break;
    }
    }
    delete importedData;
    delete iBCardEngine;
    delete iPbkContactEngine;
    inputFileStream.Close();
    file.Close();
    fs.Close();
    }
    The error code in TRAPD with ImportBusinessCardL(--) is randomly 0 or -1
    The error code in TRAPD with CommitContactL (--) is -21 always.

    I couldnt get the reason for -1 with ImportBusinessCardL n ImportContactsL too.

    Experts plz guide.

    Thanks.
    Regards,
    Shilpa Kulkarni

Similar Threads

  1. GCCE issues
    By apsaarin in forum Symbian Tools & SDKs
    Replies: 18
    Last Post: 2010-06-18, 13:13
  2. N91 WiFi (WLAN) and Bluetooth Issues.
    By danscoop in forum General Development Questions
    Replies: 12
    Last Post: 2007-06-05, 20:07
  3. 3gp streaming issues
    By njahan in forum Streaming and Video
    Replies: 0
    Last Post: 2006-11-02, 19:05
  4. Nokia management of known issues
    By springwood64 in forum Mobile Java General
    Replies: 3
    Last Post: 2006-01-17, 17:44
  5. Series 60 graphics and sound issues
    By Teh_Architect in forum Mobile Java Media (Graphics & Sounds)
    Replies: 0
    Last Post: 2005-08-08, 11:03

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×