You Are Here:

Community: Wiki

This page was last modified on 15 December 2008, at 14:01.

CS001218 - Exporting calendar entries to a text file in Flash Lite

From Forum Nokia Wiki



ID CS001218 Creation date December 15, 2008
Platform S60 5th Edition Tested on devices Nokia 5800 XpressMusic
Category Flash Lite Subcategory S60 Platform Services


Keywords (APIs, classes, methods, functions): Service.Calendar, calendar.Export()

Overview

The following code snippet demonstrates how to use the Calendar Service API in a Flash Lite 3.0 application to export calendar entries from the default calendar of the device to an external text file (supported from S60 5th Edition onwards).

Preconditions

Note: The test device needs to have at least one calendar entry in the calendar.

Source

// Import Platform Service Interface
import com.nokia.lib.Service;
// Heading of the application
heading_txt.text = "Export Calendar entries";
 
// Create a new Service object which has Calendar data
var calendar = new Service("Service.Calendar", "IDataSource");
 
// Get calendar entries from the default calendar application
// Define input parameters for the List of calendar entries
var inListParams = {Type:"CalendarEntry"};
 
// Define the result value for the List
var outListParams = calendar.GetList(inListParams);
var outList = outListParams.ReturnValue;
var outputListEntry = null;
var idList:Array = new Array();
text_txt.text += "Exported entries: \r";
// Go through all calendar events and push them to the array
do {
outputListEntry = outList.next();
if (null != outputListEntry) {
idList.push(outputListEntry.id);
text_txt.text += "-"+outputListEntry.id+"\r";
} else {
break;
}
} while (true);
 
// Define the input data for the exported text file
var inputData = {IdList:idList, Format:"VCal",
FileName:"c:\\Data\\Others\\example.txt"};
 
// Define the input parameters for export
var inParams = {Type:"CalendarEntry", Data:inputData};
 
// Define the result value
var outParams = calendar.Export(inParams);
if (outParams.ErrorCode == 0) {
text_txt.text += "Export success!";
} else {
var errorId = outParams.ErrorCode;
text_txt.text += "\rError: "+errorId;
}

Postconditions

One exported entry is saved as example.txt in the C:\Data\Others directory. The IDs of all the exported calendar entries are displayed in the application.

Example application

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

See also

Related Wiki Articles

No related wiki articles found

Rate This

 
Bookmark this page: DeliciousDiggFacebookGoogleYahooStumbleUponRedditDiigoTechnocratiTwitter  Share this page Share this page Print this Page Print this page Invite a friend Invite a friend
京ICP备05048969号    Email Newsletters Press Terms & Conditions Privacy Policy Sitemap Contact Us © 2009 Nokia 
RDF Facets: qdcZidentifierQSxhttpE3aE2fE2fwikiE2eforumE2enokiaE2ecomE2findeE78E2ephpE2fWorkE5fFlowE5fforE5fFlashE5fE4citeX qdcZtypeQUqfnZE45E78cludedFromGeneralE4cistingsQ qdcZtypeQUqfntypeZCommunityContentQ qdcZtypeQUqfntypeZE52esourceQ qdcZtypeQUqfntypeZWebpageQ qdcZtypeQUqfntypeZWikiContentQ qdcZtypeQUqmarsZManagedE52esourceQ qdcZtypeQUqwebZInformationE52esourceQ qdcZtypeQUqwebZPageQ qdcZtypeQUqwebZE52esourceQ qdcZtypeQUqrdfsZE52esourceQ qfnZtopicQUqfnTopicZflashQ qfnZtopicQUqfnTopicZflashE5fliteQ qfnZtypeQUqfntypeZCommunityContentQ qfnZtypeQUqfntypeZE52esourceQ qfnZtypeQUqfntypeZWebpageQ qfnZtypeQUqfntypeZWikiContentQ qmarsZlanguageQUxhttpE3aE2fE2fswE2enokiaE2ecomE2flanguageE2d1E2fenX qrdfZtypeQUqfnZE45E78cludedFromGeneralE4cistingsQ qrdfZtypeQUqfntypeZCommunityContentQ qrdfZtypeQUqfntypeZE52esourceQ qrdfZtypeQUqfntypeZWebpageQ qrdfZtypeQUqfntypeZWikiContentQ qrdfZtypeQUqmarsZManagedE52esourceQ qrdfZtypeQUqwebZInformationE52esourceQ qrdfZtypeQUqwebZPageQ qrdfZtypeQUqwebZE52esourceQ qrdfZtypeQUqrdfsZE52esourceQ