You Are Here:

Community: Wiki

This page was last modified on 22 May 2009, at 13:41.

How to handle contacts in m

From Forum Nokia Wiki


ID Creation date May 22, 2009
Platform S60 2nd Edition, S60 3rd Edition, S60 5th Edition Tested on devices Nokia N95, Nokia E90
Category M Subcategory PIM


Keywords (APIs, classes, methods, functions): contacts

Overview

This article shows how to add, find and delete contacts in m.

Preconditions

Note: The add and delete functions require the WriteApp permission. The find and get functions require the ReadApp permission.

Source code

Adding a contact

use contacts
 
 
//Create a contact as an array of key-value pairs
my_contact = ["name":"Doe", "fname":"John", "phone":"1234567890", "email":"john.doe@company.com"]
 
//Add it to the database
contacts.add(my_contact)

Finding contacts

use contacts
 
 
//Get the ids of the contacts that match the criteria
ids = contacts.find("John Doe", ["fname", "name"])
 
//Get the corresponding contact objects and display all their information
for id in ids do
my_contact = contacts.get(id);
for i in keys(my_contact) do
print contacts.labels()[i] + ": " + my_contact[i]
end;
end

Deleting contacts

use contacts
 
 
//Get the ids of the contacts that match the criteria
ids = contacts.find("John Doe", ["fname", "name"])
 
//Delete them all
for id in ids do
contacts.delete(id)
end

Postconditions

Contacts are added, found or deleted.

Additional information

Details about the functions used in the snippets above and others are available in the m library.

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: qdcZidentifierQSxhttpE3aE2fE2fwikiE2eforumE2enokiaE2ecomE2findeE78E2ephpE2fE25E455E25A6E2582E25E454E25BE44E2595E25E455E259CE25A8E25E456E2594E25B6E25E454E25BBE25B6E25E457E25AE45E25B1E25E455E2588E259BE25E455E25BBE25BAE25E457E259FE25AE44E25E454E25BFE25A1X qdcZtypeQUqfnZE45E78cludedFromGeneralE4cistingsQ qdcZtypeQUqfntypeZCommunityContentQ qdcZtypeQUqfntypeZE52esourceQ qdcZtypeQUqfntypeZWebpageQ qdcZtypeQUqfntypeZWikiContentQ qdcZtypeQUqmarsZManagedE52esourceQ qdcZtypeQUqwebZInformationE52esourceQ qdcZtypeQUqwebZPageQ qdcZtypeQUqwebZE52esourceQ qdcZtypeQUqrdfsZE52esourceQ qfnZtopicQUqfnTopicZseriesE5f60Q qfnZtypeQUqfntypeZCommunityContentQ qfnZtypeQUqfntypeZE52esourceQ qfnZtypeQUqfntypeZWebpageQ qfnZtypeQUqfntypeZWikiContentQ qfnZuserE5ftagQSxs60X qmarsZlanguageQUxhttpE3aE2fE2fswE2enokiaE2ecomE2flanguageE2d1E2fenX qrdfZtypeQUqfnZE45E78cludedFromGeneralE4cistingsQ qrdfZtypeQUqfntypeZCommunityContentQ qrdfZtypeQUqfntypeZE52esourceQ qrdfZtypeQUqfntypeZWebpageQ qrdfZtypeQUqfntypeZWikiContentQ qrdfZtypeQUqmarsZManagedE52esourceQ qrdfZtypeQUqwebZInformationE52esourceQ qrdfZtypeQUqwebZPageQ qrdfZtypeQUqwebZE52esourceQ qrdfZtypeQUqrdfsZE52esourceQ