Help Center
Local Navigation
- Integrating with BlackBerry Device Software applications
- Unified search
- Device interaction support
- Message list
- Custom messages
- Attachments
- Calendar
- Contact list
-
Task list
- View or change a task
- Create a new blank task
- Create a new populated task
- Open a task list
- Create a task
- Add task information
- Change task information
- Save a task
- Retrieve task information
- Export a task
- Import a task
- Delete a task
- Close the task list
- Notify a BlackBerry device application when a list of tasks changes
- 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 task
- Import the required classes and interfaces.
import java.io.ByteArrayOutputStream; import java.util.Enumeration; import javax.microedition.pim.PIM; import javax.microedition.pim.ToDo; import javax.microedition.pim.ToDoList;
- Use an output stream writer to export tasks from the BlackBerry® device to a supported serial format.
- To retrieve a string array of supported serial formats, invoke PIM.supportedSerialFormats(), and then specify the list type (PIM.TODO_List).
- To write an item to a serial format, invoke PIM.getInstance().toSerialFormat. 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.
ToDoList todoList = (ToDoList)PIM.getInstance().openPIMList(PIM.TODO_LIST, PIM.READ_ONLY); ByteArrayOutputStream byteStream = new ByteArrayOutputStream(); String[] dataFormats = PIM.getInstance().supportedSerialFormats(PIM.TODO_LIST); Enumeration e = todoList.items(); while (e.hasMoreElements()) { ToDo task = (ToDo)e.nextElement(); PIM.getInstance().toSerialFormat(task, byteStream, "UTF8", dataFormats[0]); }
Next topic: Import a task
Previous topic: Retrieve task information