24
BlackBerry Device Applications Integration Guide
2.
Complete any of the following actions:
Task
Steps
Open a folder view.
1.
Invoke
store.list()
to retrieve a list of folders.
Store store = null;
store = Session.waitForDefaultSession().getStore();
Folder[] folders = store.list();
2. Invoke i
nvokeApplication()
using the APP_TYPE_MESSAGES constant parameter and a new
MessageArguments
object that uses a folder from the list of folders as a parameter.
Invoke.invokeApplication(Invoke.APP_TYPE_MESSAGES, new MessageArguments(
folders[0]));
List the folders in a mailbox
store.
>
Invoke
Store.list().
Folder[] folders = store.list();
Retrieve an array of folders by
type.
>
Invoke l
ist(int)
and provide as a parameter the folder type.
Folder[] folders = store.list(INBOX);
Folder inbox = folders[0];
Retrieve an array of folders
through a search.
>
Invoke
findFolder(String)
.
Folder[] folders = store.findFolder("Inbox");
Retrieve a folder by its name. 1.
Invoke g
etFolder(String)
and provide as a parameter the absolute path to the folder.
Folder folder = store.getFolder("Mailbox - Aisha Wahl/Inbox/Projects");
2. Create code to manage
a FolderNotFoundException
exception if the folder does not exist.
Retrieve a folder by its ID.
1.
Invoke
getID()
to retrieve the folder ID.
2. Invoke
getFolder()
with the ID as a parameter.
Folder[] folders = store.list();
long id = folders[0].getId();
Folder f2 = store.getFolder(id);
File a message.
>
Invoke
appendMessage(Message)
on a
Folder
object.
Message msg = new Message();
//...
Folder folder = store.getFolder("Inbox");
folder.appendMessage(msg);
Summary of Contents for JAVA DEVELOPMENT ENVIRONMENT - - DEVICE APPLICATIONS INTEGRATION - DEVELOPMENT GUIDE
Page 4: ......
Page 7: ......
Page 10: ...10 BlackBerry Device Applications Integration Guide...
Page 12: ...12 BlackBerry Device Applications Integration Guide...
Page 50: ...50 BlackBerry Device Applications Integration Guide...
Page 56: ...56 BlackBerry Device Applications Integration Guide...
Page 65: ......
Page 66: ...2008 Research In Motion Limited Published in Canada...