ToDo API

The to-do API supports a subset of the vToDo fields that are defined in the vCalendar RFC 2445 specification. Analogous to the addressbook and calendar API, the to-do API contains specializations of the PIMElement and PIMList interfaces, namely the ToDo and ToDoList interfaces.

Field IDs supported in the ToDo interface are COMPLETED, DUE, NOTE, PRIORITY, SUMMARY, and UID. The following code snippet illustrates the usage of the ToDo API:

TodoList myTodoList = PIM.openTodoList(PIM.READ_WRITE);

Todo myTodo = myTodoList.createTodo();

myTodo.set(Todo.SUMMARY, "Buy a book covering MIDP and PDAP");
myTodo.set(Todo.DUE, new Date());
myTodo.set(Todo.NOTE, "Perhaps Sams offers a good one."
        + "Take a look on their website first.");
myTodo.set(Todo.PRIORITY, 1);

myTodo.commut ();
myTodoList.close();

Like the EventList, the ToDoList supports an elements() method that returns an enumeration containing all ToDo elements ranging from a start date to an end date. Repeat patterns are not supported for ToDos.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset