32
BlackBerry Device Applications Integration Guide
2.
To register to receive notifications of changes to an event list, invoke
BlackBerryPIMList.addListener()
.
BlackBerryPIMList eventList =
(BlackBerryPIMList)PIM.getIntsance().openPIMList(PIM.EVENT_LIST, PIM.READ_WRITE);
eventList.addListener(new myEventListListener3());
3. To have an application always listen to the default PIMList, add the following to the
defaultChanged()
method.
BlackBerryPIMList defaultEventList =
(BlackBerryPIMList)PIM.getInstance().openPIMList(PIM.EVENT_LIST, PIM.READ_WRITE,
newDefault);
defaultEventList.addListener(this);
pimList.removeListener(this);
Retrieve multiple lists of events
The first element in the array of lists is the default list.
>
Invoke
PIM.listPIMLists(int pimListType)
.
String[] allLists = PIM.listPIMLists(EVENT_LIST);
Using the address book
Open the address book from your BlackBerry Java Application
Use contacts
Task
Steps
Open the address book.
>
From a BlackBerry® Java® Application, invoke
Invoke.invokeApplication(APP_TYPE_ADDRESSBOOK,AddressBookArgum
ents)
.
Open a contact using PIM data.
1.
Create an instance of an
AddressBookArguments
object, specifying as a parameter
a
Contact
object.
AddressBookArguments abArg = AddressBookArguments(String arg,
Contact contact);
2. Invoke
Invoke.invokeApplication(APP_TYPE_ADDRESSBOOK,
AddressBookArguments)
using the
AddressBookArguments
object for the
contact.
Invoke.invokeApplication(APP_TYPE_ADDRESSBOOK, abArg);
Manage exceptions.
>
Check for a
ControlledAccessException
if your BlackBerry® Java® Application
invokes a BlackBerry application that you do not have permission to use or access.
Task
Steps
Provide access to the PIN BlackBerry® device
contacts field.
>
Use the
BlackBerryContact.PIN
constant.
Содержание JAVA DEVELOPMENT ENVIRONMENT - - DEVICE APPLICATIONS INTEGRATION - DEVELOPMENT GUIDE
Страница 1: ...BlackBerry Java Development Environment Version 4 6 0 BlackBerry Device Applications Integration Guide...
Страница 4: ......
Страница 7: ......
Страница 10: ...10 BlackBerry Device Applications Integration Guide...
Страница 12: ...12 BlackBerry Device Applications Integration Guide...
Страница 50: ...50 BlackBerry Device Applications Integration Guide...
Страница 56: ...56 BlackBerry Device Applications Integration Guide...
Страница 65: ......
Страница 66: ...2008 Research In Motion Limited Published in Canada...