Troubleshooting guide

148
BlackBerry Java Development Environment Development Guide
Register applications when the BlackBerry device starts
To register the event source when the BlackBerry® device starts, create a separate project that acts as an
alternative entry point to the main application. When the BlackBerry device starts, this project automatically runs
as a system module and passes an argument to the application, allowing the application to perform any one-time
initialization. You cannot pass arguments to MIDlet applications when the BlackBerry device starts.
Communicate with other applications
> To post a system-level event to other applications, invoke one of the
ApplicationManager.postGlobalEvent() methods.
Determine the services that are available to BlackBerry
applications
The service book consists of service records, each of which defines a service on a BlackBerry® device. Service
records define the communication protocol (WAP or IPPP), the network gateway, and the configuration
information such as browser settings.
> To let your application interact with the BlackBerry Infrastructure, use the service book API
(net.rim.device.api.servicebook).
Task Steps
Retrieve information about the
processes that are running.
1. In the BlackBerry Integrated Development Environment, create a project.
2. Right-click the project, and then click Properties.
3. Click the Application tab.
4. In the Project type drop-down list, click Alternate CLDC Application Entry Point.
5. In the Alternate entry point drop-down list, click the alternate entry point project.
6. In the Arguments passed to field, type autostartup.
7. Select the Auto-run on startup option.
8. Select the System module option.
9. Click OK.
Perform initializations at the alternative
entry point.
>In your main() method, perform the required initialization. For example:
public static void main (String[] args)
{if ( args.length > 0 && args[0].equals("autostartup")) {
//Application runs as a system module at startup.
//Perform any necessary one-time automatic initialization.
} else {
//Application is being run by a user.}
}