BlackBerry
 





Home > Worldwide Developers > Java Knowledge Base Search > Knowledge Base Article

Java Knowledge Base

Knowledge Base Article

Using Alternate Application Entry points

Article Information: An Alternate Application Entry point is a mechanism used to enter a program that is already running in the background. The following example illustrates this mechanism.

Application A is a background application that auto-runs on startup. It does have a UI, but when it is running in the background, it is not being used. Application B is an alternate entry point for application A, which consists of only a ribbon icon. When you click the icon for application B it passes a parameter to application A, telling A to now become a foreground application, that is, make the UI visible to the user. It does this by calling the main method of application A, with the parameter chosen.

To mark your project as an alternate entry point, create a new, empty project within the same workspace of the project (application) that you want to enter. You can add an icon to this new project. (refer to How do I create a Ribbon Icon for my application?) Right-click the new project and click Properties. If your main application is a CLDC application, go to the Application tab of this new project and set the Application Type to Alternate CLDC Application Entry Point (or set it to Alternate MIDP Application Entry Point if your main application is a MIDlet). You can then set the parameter to send (if any) in the Parameters field – this will get sent as an argument to the static public void main(String args[]) method of the main application.


More Information:

       
 Legal | Copyright © 2002 Research In Motion Limited, unless otherwise noted.