Using custom messages and folders in the message list
5
You can use the
net.rim.blackberry.api.messagelist
package to create custom messages and folders for a
BlackBerry® device application.
To use custom folders and messages in a BlackBerry device application, you must create an application with the following modules:
•
a UI module for interacting with a BlackBerry device user
•
a module for interacting with an application server and performing other actions in the background
Both modules are part of the same BlackBerry device application but have different application entry points.
You must determine the functionality that is part of each module. For example, a menu item that lets a BlackBerry device user
delete a message or mark a message as read should be part of the daemon module. A menu item that lets a BlackBerry device
user open or reply to a message should be part of the UI module.
Creating a module for background processes
The daemon module runs without input from a BlackBerry® device user and can send messages to and receive messages from
an application server and can add messages to the global message list. The daemon module can transfer messages using a native
protocol or through email messaging. The daemon module starts automatically when the BlackBerry device starts. A BlackBerry
device user cannot start or stop the daemon module.
The daemon module can also register an BlackBerry device application folder when the BlackBerry device starts and can listen
for updates to the application message folder such as when a BlackBerry device user deletes a message or marks a message as
read or unread.
Creating a module for the UI
The UI module runs when a BlackBerry® device user clicks the icon for a BlackBerry device application from the Home screen
and is used to interact with a BlackBerry device user. The UI module can contain a dialog box, a screen, fields, and other
components.
For example, if a BlackBerry device user highlights a custom message in the global message list and clicks the trackball, the UI
module should start and render the message content. If the UI module is not running and a BlackBerry device user attempts to
open custom message, the UI module starts automatically. The UI module can also provide Reply or Compose message functions.
Create the module for background processes
1.
Create a project as
Auto-Run On Startup
.
Development Guide
Using custom messages and folders in the message list
70