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
Import a calendar entry
- Import the required classes and interfaces.
import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import javax.microedition.pim.Event; import javax.microedition.pim.EventList; import javax.microedition.pim.PIM;
- Invoke PIM.getInstance().fromSerialFormat() to return an array of PIMItem objects.
- Invoke EventList.importEvent()
to add a new calendar entry.
// Convert an existing entry into a iCal and then // import the iCal as a new entry String[] dataFormats = PIM.supportedSerialFormats(); // Write entry to iCal ByteArrayOutputStream os = new ByteArrayOutputStream(); PIM.getInstance().toSerialFormat(event, os, "UTF8", dataFormats[0]); // Import entry from iCal ByteArrayInputStream is = new ByteArrayInputStream(os.toByteArray()); PIMItem[] pi = PIM.getInstance().fromSerialFormat(is, "UTF8"); EventList eventList = (EventList)PIM.getInstance().openPIMList(PIM.EVENT_LIST, PIM.READ_WRITE); Event event2 = eventList.importEvent((Event)pi[0]);
Next topic: Retrieve multiple lists of calendar entries
Previous topic: Export a calendar entry