
Linked below, a new BlackBerry Knowledge Base Document offers instructions for working within the BlackBerry Java Development Environment to create an Event within the BlackBerry Calendar application.
This is possible because BlackBerry JDE 4.0 offers the personal digital assistance profile (PDAP) package to provide allow access to the Calendar, Tasks, and Address Book applications on the BlackBerry device.
Included within the net.rim.blackberry.api.pdap package is the BlackBerryEvent interface, This interface defines extended fields in the event, along with the standard fields obtained through the javax.microediition.pim.Event interface.
Want sample code? Turn the page (just thought of that old Bob Seger song as I typed that).
Well anyway:
EventList _eventList = null;
try {
// Creates/Opens an instance of the specified PIM list (Event List) in Read/Write mode.
_eventList = (EventList)PIM.getInstance().openPIMList(PIM.EVENT_LIST, PIM.READ_WRITE);
// Creates a new Event
BlackBerryEvent bbEvent = (BlackBerryEvent)_eventList.createEvent();
// Checks the Event List to determine if the ALLDAY field is supported
if(_eventList.isSupportedField(BlackBerryEvent.ALLDAY)) {
// Checks the event to determine if ALLDAY attribute as already be set
if(bbEvent.countValues(BlackBerryEvent.ALLDAY) > 0) {
bbEvent.setBoolean(BlackBerryEvent.ALLDAY,0,Event.ATTR_NONE,true);
} else {
bbEvent.addBoolean(BlackBerryEvent.ALLDAY,Event.ATTR_NONE,true);
}
}
} catch(PIMException e) {
// Handle Exception
K, got that?







