You Are Here:

Community: Wiki

This page was last modified on 19 January 2010, at 10:55.

CS001223 - Listing contacts in Flash Lite

From Forum Nokia Wiki



ID CS001223 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.Contact, contact.GetList()

Overview

The following code snippet demonstrates how to use the Contact Service API in a Flash Lite 3.0 application to list contacts of the default phonebook (supported from S60 5th Edition onwards).

Source

// Import Platform Service Interface
import com.nokia.lib.Service;
// Heading of the application
heading_txt.text = "List Contacts (firstname)";
 
// Create a new Service object which has Contact data
var contact = new Service("Service.Contact", "IDataSource");
 
// Define input parameters
var inParams = {Type:"Contact"};
 
// Define the result value
var outParams = contact.GetList(inParams);
if (outParams.ErrorCode == 0) {
var outList = outParams.ReturnValue;
var outputEntry = null;
do {
outputEntry = outList.next();
if (null != outputEntry) {
// Get firstname of the contact and trace it to the textfield
var firstname = outputEntry.FirstName["Value"];
text_txt.text += "-"+firstname+"\r";
} else {
break;
}
} while (true);
} else {
// if errors, copy them to the textfield
var errorId = outParams.ErrorCode;
text_txt.text += "Error: "+errorId;
}

Postconditions

All contacts of the default phonebook are displayed.

Example application

The following sample application has been tested in Nokia 5800 XpressMusic (S60 5th edition, Flash Lite 3.0).
File:FlashLite List Contacts.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 © 2010 Nokia 
RDF Facets: qdcZidentifierQSxhttpE3aE2fE2fwikiE2eforumE2enokiaE2ecomE2findeE78E2ephpE2fCapturingE5fandE5fuploadingE5fimageE2cE5fvideoE5forE5faudioE5ffilesE5ftoE5fserverE5fwithE5fFlashE5fE4citeE5fandE5fAPIBridgeX qdcZtypeQUqfnZE45E78cludedFromGeneralE4cistingsQ qdcZtypeQUqfnTypeZCodeSnippetQ qdcZtypeQUqfnTypeZCommunityContentQ qdcZtypeQUqfnTypeZKnowledgeBaseContentQ qdcZtypeQUqfnTypeZE52esourceQ qdcZtypeQUqfnTypeZWikiContentQ qdcZtypeQUqmarsZManagedE52esourceQ qdcZtypeQUqwebZE52esourceQ qdcZtypeQUqrdfsZE52esourceQ qfnZtopicQUqfnTopicZflashQ qfnZtopicQUqfnTopicZflashE5fliteQ qfnZtypeQUqfnTypeZCodeSnippetQ qfnZtypeQUqfnTypeZCommunityContentQ qfnZtypeQUqfnTypeZKnowledgeBaseContentQ qfnZtypeQUqfnTypeZE52esourceQ qfnZtypeQUqfnTypeZWikiContentQ qmarsZlanguageQUxhttpE3aE2fE2fswE2enokiaE2ecomE2flanguageE2d1E2fenX qrdfZtypeQUqfnZE45E78cludedFromGeneralE4cistingsQ qrdfZtypeQUqfnTypeZCodeSnippetQ qrdfZtypeQUqfnTypeZCommunityContentQ qrdfZtypeQUqfnTypeZKnowledgeBaseContentQ qrdfZtypeQUqfnTypeZE52esourceQ qrdfZtypeQUqfnTypeZWikiContentQ qrdfZtypeQUqmarsZManagedE52esourceQ qrdfZtypeQUqwebZE52esourceQ qrdfZtypeQUqrdfsZE52esourceQ