The Nokia 9110i Communicator uses Contact databases to store
"address book" information. Every time the user enters
information about how a place may be reached by phone, fax, or e-mail
that information is stored in a Contact database, accessed via
the contdb
library.
Whenever you prompt the user for information about where to send
something, you'll probably use a ContactList
. This will allow
the user to choose which of their contacts should be the recipient.
There are two libraries which exist to keep track of Contact databases and provide an API for the applications which share access to it.
contdb
library keeps track of the contact information, and may be used
to look up or edit contact information. It also provides a
controller which allows the user to choose a contact from a list
of existing contacts.contLog
library provides an API for logging what sorts of communication
has been made with the entities described in the Contact database.
It also provides a controller which allows the user to select a
recently contacted contact.Contact database are Foam databases, and some operations upon the database will make use of Foam database commands. We will not explore the meanings of these commands closely here, but will show how they are used in the context of Contact databases.
Before reading this chapter, you should be familiar with
controllers, Object-Oriented Programming, and the GEOS messaging
system. It helps if you try out the "Contacts" built-in
application, which demonstrates much of the functionality we'll
discuss here. The appl/SDK_9000/Contact/
sample
application gives full source for the most useful Contact database
operations.
Most programmers first encounter the contdb
and ContLog
libraries when they need to intercept
a message associated with a ContactList
or perhaps a RecentContactsControl
object. These object classes provide the user with a standard
way to choose a contact.
There are other controllers which allow the user to choose
an SMS contact. SMAddressControlClass
allows the
user to choose a recipient for a SMS message. This class should
cover some applications' needs when it comes to allowing the
user to choose a contact. However, if you need a custom
control, you may wish to use a ContactList
and/or a RecentContactsSMSControl
.
A ContactList
presents the user with a list of
known contacts. The user may choose a name from the list.
In Setting up a Contact List, we show how to set up such an object and get the phone number of
the contact the user selects.
The RecentContactsSMSControl
presents the user
with a list containing names and numbers associated with contacts
that have recently had SMS transactions with the user. The user
may choose a name or number from the list. In
Choosing Contacts From a Log, we show how to set up such an object and get the phone number of
the contact the user selects.
1 Setting up a Contact List
1.1 Multiple-Selection ContactLists and Groups
1.2 Remembering the Search
1.3 Detecting Unknown Phone Numbers
1.4 Alternate Messages
2 Choosing Contacts From a Log
3 Using a Dedicated Contact
4 Logging Calls
5 To Get More Info on a Contact
6 The User's Own Data