You Are Here:

Community: Wiki

This page was last modified on 26 January 2009, at 10:58.

CS001290 - Importing landmarks in Flash Lite

From Forum Nokia Wiki



ID CS001290 Creation date January 26, 2009
Platform S60 5th Edition Tested on devices Nokia 5800 XpressMusic
Category Flash Lite Subcategory Location


Keywords (APIs, classes, methods, functions): Service.Landmarks, landmark.Import()

Overview

This code snippet demonstrates how to import landmarks from the file using the Landmarks Platform Service for Flash Lite supported from S60 5th Edition onwards.

Preconditions

Note: To import landmarks with this application you need to have copied a landmarks file (landmarks.lmx ) in the folder c:\Data\\Others\ on your device.

Source

// Import Platform Service Interface
import com.nokia.lib.Service;
// Heading of the application
heading_txt.text = "Importing landmarks";
 
text_txt.text = "Press the Import button to import landmarks from " +
"c:\\Data\\Others\\landmarks.lmx";
 
// Create new Service object which has Landmark information
var landmark = new Service("Service.Landmarks", "IDataSource");
 
/**********************************************************
** Function for pressing the Import button.
** Calls Import() method synchronously.
** Method imports landmarks from the file
**********************************************************/

import_mc.onPress = function() {
text_txt.text = "Imported landmarks:\r";
 
// Define input parameters
var inputData = {
SourceFile:"c:\\Data\\Others\\landmarks.lmx",
MimeType:"application/vnd.nokia.landmarkcollection+xml"
};
var inParams = {Type:"Landmark", Data:inputData};
 
// Define result value
var outParams = landmark.Import(inParams);
var outList = outParams.ReturnValue;
var i = 0;
if (outParams.ErrorCode == 0) {
var outputEntry = null;
do {
i++;
outputEntry = outList.next();
if (null != outputEntry) {
text_txt.text += "Landmark "+i+"\r"+outputEntry.LandmarkName+
"\r"+outputEntry.id+"\r";
} else {
break;
}
} while (true);
} else {
var errorId = outParams.ErrorCode;
text_txt.text = "Error while importing: "+errorId;
};
};

Postconditions

Imported landmarks are displayed. Landmarks can be imported by pressing the Import button.

Example application

The following sample application has been tested in the Nokia 5800 XpressMusic (S60 5th Edition, Flash Lite 3.0). File:FlashLite Importing Landmarks.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: qdcZidentifierQSxhttpE3aE2fE2fwikiE2eforumE2enokiaE2ecomE2findeE78E2ephpE2fAdobeE5fE44eviceE5fCentralX 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