Namespaces
Variants
Actions

Importing business cards (vCard) using Symbian C++

Jump to: navigation, search



Article Metadata

Compatibility
Platform(s): S60 1st Edition
S60 2nd Edition

Article
Created: User:Technical writer 2 (21 Nov 2003)
Last edited: hamishwillee (14 Jun 2012)

Overview

How can I import more than one business cards (vCard) from an RReadStream source to the contacts database using CBCardEngine::ImportBusinessCardL()?

Description

The ImportBusinessCardL() function reads only one vCard from a source stream into a single contact item 'aDestItem'. When importing a contact item using ImportBusinessCardL(), you don't have to take care of the length of the data stream, in other words, you don't need to detect the end of the stream. If the source stream contains more than one card and you want to import all the vCards to the contacts database, use CContactDatabase::ImportContactsL() and specify the aOption parameter accordingly. If, for some reason, you want to import more than one card using CBCardEngine::ImportBusinessCardL(), follow this workaround solution:

Solution

1. Use CParserVCard to parse the aSourceStream.
2. Call either EntityL(_L("VCARD"),...) or ArrayOfEntities() to get an array of CVersitParser objects.
3. Iterate the array and call ExternalizeL(RWriteStream).
4. Convert the RWriteStream object into an RReadStream object.
5. Call ImportBusinessCardL() with the new aSourceStream.
6. Repeat steps 3-5 to get the next object until all items in the array are done.

This page was last modified on 14 June 2012, at 09:06.
99 page views in the last 30 days.
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved