28
BlackBerry Device Applications Integration Guide
Use the calendar
Open a new populated event.
1.
Create a new
Event
using an
EventList object
.
Event e = null;
EventList el = (EventList)PIM.getInstance().openPIMList(
PIM.EVENT_LIST, PIM.READ_WRITE );
e = el.createEvent();
2. Add information to the
Event
object.
e.addString( Event.SUMMARY, 0, "Go For A Walk" );
e.addString( Event.LOCATION, 0, "The Park" );
long start = System.currentTimeMillis() + 8640000;
e.addDate( Event.START, 0, start );
e.addDate( Event.END, 0, start + 72000000 );
3. Invoke
Invoke.invokeApplication(APP_TYPE_CALENDAR, CalendarArguments)
using the
CalendarArguments
object created using the ARG_NEW property and the
Event
.
Invoke.invokeApplication( Invoke.APP_TYPE_CALENDAR, new
CalendarArguments( CalendarArguments.ARG_NEW, e ) );
4. Use an instance of the
EventList
class to access the calendar.
5. Create one or more
Event
objects to store information for specific appointments. For each event,
you can store data such as the summary, location, start and end times, and reminder notification.
Task
Steps
Open an event list.
>
Create an
EventList
object by invoking
openPIMList()
, providing as parameters the type of
list to open (
PIM.EVENT_LIST
) and the mode in which to open the list:
•
READ_WRITE
•
READ_ONLY
•
WRITE_ONLY
EventList eventList = null;
try {
eventList = (EventList)PIM.getInstance().openPIMList(
PIM.EVENT_LIST, PIM.READ_WRITE);
} catch (PimException e) {
// Handle exception.
}
Create an appointment.
>
Invoke
createEvent()
on an event list
.
Event event = eventList.createEvent():
Task
Steps
Содержание 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...