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
Export a calendar entry
- Import the required classes and interfaces.
import java.io.ByteArrayOutputStream; import java.util.Enumeration; import javax.microedition.pim.Event; import javax.microedition.pim.EventList; import javax.microedition.pim.PIM;
- Invoke PIM.supportedSerialFormats() specifying the list type (PIM.EVENT_LIST), to retrieve a string array of supported serial formats.
String[] dataFormats = PIM.supportedSerialFormats(PIM.EVENT_LIST);
- Use an output stream writer to export calendar entries from the BlackBerry® device to a supported serial format, such as iCal.
- Invoke toSerialFormat()
to write an item in serial format. The enc parameter specifies the character encoding to use when writing to the output stream. Supported character encodings include “UTF8,” “ISO-8859-1,” and “UTF-16BE”. This parameter cannot be null.
EventList eventList = (EventList)PIM.getInstance().openPIMList( PIM.EVENT_LIST, PIM.READ_ONLY ); ByteArrayOutputStream bytestream = new ByteArrayOutputStream(); Enumeration e = eventList.items(); while (e.hasMoreElements()) { Event event = (Event)e.nextElement(); PIM.getInstance().toSerialFormat(event, bytestream, "UTF8", dataFormats[0]); }
Next topic: Import a calendar entry
Previous topic: Retrieve calendar entry information