Java Reference
In-Depth Information
public String [] getCategories()
public int maxCategories()
public void addToCategory(String category) throws PIMException
public void removeFromCategory(String category)
getCategories()
gets a list of the categories associated with the contact.
maxCategories()
can be used to discover the maximum number of categories that can be assigned to a contact—
this is highly implementation dependent.
addToCategory()
will add a category association to a
contact.
removeFromCategory()
removes a category association from a contact.
Standard Fields on an Item
A
PIMItem
can hold a contact record, an event record from the event list, or a to-do item from
the to-do list. Accordingly, the
PIMItem
interface is the superinterface to the
Contact
,
Event
, and
ToDo
interfaces.
The
PIMItem
interface contains many methods for working with fields within an item. The
PIM functions of a device are typically accessed by native applications. This may be a phone
directory application on a cell phone or an address book on a wireless PDA. The set of fields
supported and their format can be quite different between devices. As a result, the PIM API
must be able to deal with a completely flexible set of fields.
Each of the
Contact
,
Event
, and
ToDo
interfaces defines a set of constants that can be used
to specify a set of “standard fields” in the record. The standard fields for
Contact
are based on
the vCard 3.0 specifications from the Internet Mail Consortium (
http://www.imc.org/pdi/
).
The vCard format is a cross-platform data interchange format that is widely used by contact
management applications.
■
Note
The set of standard fields in the
Event
and
ToDo
items is based on the vCalendar 1.0 specification
from the Internet Mail Consortium. You can work with these fields in the same way as the fields in
Contact
.
For example,
Contact
defines the standard fields and subfields detailed in Table 9-1.
The
Contact
interface has constants defined for all of these fields and subfields.
Table 9-1.
Standard Fields of a Contact Record
Field Name/Constant
Description
Data Type
ADDR
String []
Field specifying address.
ADDR_COUNTRY
Index into
ADDR
of the country portion of the address.
String
ADDR_EXTRA
Index into
ADDR
of extra information in the address.
String
ADDR_LOCALITY
Index into
ADDR
of locality information associated with an
address. Typically used to hold city name.
String
ADDR_POBOX
Index into
ADDR
of the post office box associated with
the address.
String
Search WWH ::
Custom Search