Please note that as of October 24, 2014, the Nokia Developer Wiki will no longer be accepting user contributions, including new entries, edits and comments, as we begin transitioning to our new home, in the Windows Phone Development Wiki. We plan to move over the majority of the existing entries over the next few weeks. Thanks for all your past and future contributions.

Archived:Exporting a contact in Flash Lite

From Wiki
Jump to: navigation, search

Archived.pngArchived: This article is archived because it is not considered relevant for third-party developers creating commercial solutions today. If you think this article is still relevant, let us know by adding the template {{ReviewForRemovalFromArchive|user=~~~~|write your reason here}}.

We do not recommend Flash Lite development on current Nokia devices, and all Flash Lite articles on this wiki have been archived. Flash Lite has been removed from all Nokia Asha and recent Series 40 devices and has limited support on Symbian. Specific information for Nokia Belle is available in Flash Lite on Nokia Browser for Symbian. Specific information for OLD Series 40 and Symbian devices is available in the Flash Lite Developers Library.

This code snippet demonstrates how to use the Contact Service API in Flash Lite 3.0 application to export a contact from the phonebook to a VCard file. It is supported from S60 5th Edition onwards.

Article Metadata
Code ExampleTested with
Devices(s): Nokia 5800 XpressMusic
Platform(s): S60 5th Edition
S60 5th Edition
Keywords: Service.Contact, contact.Export()
Created: User:Nokia Developer KB (15 Dec 2008)
Last edited: hamishwillee (14 May 2013)



Note.pngNote: For a successful contact export with this application you need to have the contact information for Eric Example in your phonebook. Only first name and last name are mandatory information.


// Import Platform Service Interface
// Heading of the application
heading_txt.text = "Export Contact";
// Create new Service object which has Calendar data
var contact = new Service("Service.Contact", "IDataSource");
// Define input parameters for the list
var inParams = {Type:"Contact"};
// Define result value
var outParams = contact.GetList(inParams);
if (outParams.ErrorCode == 0) {
var outList = outParams.ReturnValue;
var outputEntry = null;
do {
outputEntry =;
if (null != outputEntry) {
// Get firstname and lastname of the contact
var firstname = outputEntry.FirstName["Value"];
var lastname = outputEntry.LastName["Value"];
var phone = outputEntry.LandPhoneHome["Value"];
// Take the ID from the contact which you like to export to the
// VCard
if(firstname == "Eric" && lastname == "Example") {
var contactId =;
text_txt.text += "Contact information for VCard:\r";
text_txt.text += "First name: "+firstname+"\r";
text_txt.text += "Last name: "+lastname+"\r\r";
} else {
} while (true);
} else {
// if errors trace them to the textfield
var errorId = outParams.ErrorCode;
text_txt.text += "Error while listing: "+errorId+"\r";
// Define the VCard file for export
var inputData = {DestinationFile:"c:\\Data\\Others\\contact.vcf",
var inExportParams = {Type:"Contact", Data:inputData};
var outExportParams = contact.Export(inExportParams);
if (outExportParams.ErrorCode == 0) {
text_txt.text += "Export success!";
} else {
var errorId2 = outExportParams.ErrorCode;
text_txt.text += "Error while exporting: "+errorId2;


Information of the exported contact is displayed. The exported VCard file can be found in the c:\\Data\\Others folder on the device.

Example application

The following sample application has been tested in Nokia 5800 XpressMusic (S60 5th edition, Flash Lite 3.0).
File:FlashLite Export

See also

This page was last modified on 14 May 2013, at 06:17.
34 page views in the last 30 days.

Was this page helpful?

Your feedback about this content is important. Let us know what you think.


Thank you!

We appreciate your feedback.