Help Center
Local Navigation
- Integrating with BlackBerry Device Software applications
- Unified search
- Device interaction support
- Message list
- Custom messages
- Attachments
-
Calendar
- Open the calendar
- View or change a calendar entry
- Open a new populated calendar entry
- Update calendar entry information
- Retrieve calendar entry information
- Export a calendar entry
- Import a calendar entry
- Retrieve multiple lists of calendar entries
- Notify a BlackBerry device application when a list of calendar entries changes
- Notify a BlackBerry device application when the default list of calendar entries changes
- Update a calendar entry with no notification
- Remove a calendar entry with no notification
- Contact list
- Task list
- Phone
- BlackBerry Browser
- Menu items
- Find more information
- Glossary
- Provide feedback
- Document revision history
- Legal notice
BlackBerry Manuals & Help
>
Developer Documentation
>
Java Development Guides and API Reference
>
Development Guide
Integration - BlackBerry Java SDK - 6.0
Open a new populated calendar entry
- Import the required classes and interfaces.
import javax.microedition.pim.PIM; import javax.microedition.pim.Event; import javax.microedition.pim.EventList; import net.rim.blackberry.api.invoke.CalendarArguments; import net.rim.blackberry.api.invoke.Invoke; import net.rim.device.api.system.ControlledAccessException;
- Create a new Event using an EventList object.
EventList el = (EventList)PIM.getInstance().openPIMList( PIM.EVENT_LIST, PIM.READ_WRITE ); Event e = el.createEvent();
- 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 );
- Invoke Invoke.invokeApplication(APP_TYPE_CALENDAR, CalendarArguments) using the CalendarArguments object created using the ARG_NEW field and the Event.
Invoke.invokeApplication( Invoke.APP_TYPE_CALENDAR, new CalendarArguments( CalendarArguments.ARG_NEW, e ) );
Next topic: Update calendar entry information
Previous topic: View or change a calendar entry