Application Integration


This category contains the packages that enable you to integrate your applications with BlackBerry Device Software applications in a variety of ways that benefit users. This category discusses how to do the following:

Invoking Applications

The BlackBerry JDE provides several ways to invoke applications. Follow these guidelines when invoking applications on the BlackBerry device.

Invoking BlackBerry Device Software applications

Use the BlackBerry Invoke API to configure your application to handle specific data in one of the BlackBerry Device Software applications, such as Phone, Tasks, Camera, and BlackBerry Maps.


To use this API, invoke invokeApplication(int appType, ApplicationArguments args), passing in application type and any relevant arguments. Optionally, you can pass in null instead of Application arguments. However, if you pass in null, it has the same effect as passing in an ApplicationArguments object create with the default constructor.

Click here to view a BlackBerry Invoke API code sample.

Invoking other (non-core) applications


The Content Handler API, or CHAPI, defines an optional package of APIs and an execution model for remotely invoking non-core BlackBerry applications. Used together with the Blackberry content handler API, CHAPI is the ideal mechanism for setting invocation parameters for non-core BlackBerry applications. For general information on the CHAPI framework, refer to the javax.microedition.content package overview.

Using CHAPI, you can invoke applications by providing either a URL, content type, or content ID when using one of the constructors available in javax.microedition.content.Invocation class.

Click here to view a CHAPI code sample.

Invoking the BlackBerry Browser


When handling specific MIME-encoded types of data, you may want to render the information directly in the BlackBerry Browser. To do so, use the methods available in the BrowserSession class. For example:


To ensure that the BlackBerry Browser can correctly render the data, use the net.rim.blackberry.api.browser BrowserContentProviderRegistry class to add the MIME type to the Browser registry.

Click here for a code sample that illustrates how to launch a BlackBerry Browser session from within a BlackBerry application.

Integrating Context Menus


You can use these packages to integrate BlackBerry context-sensitive menus into your application. For example, you can configure your application to recognize a specific string of numbers as a phone number, and provide a list of menu options when the user clicks on the number.

The net.rim.blackberry.api.menuitem.ApplicationMenuItem class includes the action that will occur once a match is found and is invoked by the BlackBerry smartphone user.

Click here for a code sample on how to configure a zip code lookup in the BlackBerry browser based on a 5 digit string.

The net.rim.blackberry.api.stringpattern.PatternRepository class registers a Perl-style regular expression or a specific string with the systems pattern repository. When a match is found, the ApplicationMenuItem(s) associated with the patterns appear in the current application's menu.

Click here for a code sample on registering the ApplicationMenuItem configured in the previous code sample.

Embedding BlackBerry Multimedia Fields

You can view a variety of multimedia content in your application, such as BlackBerry camera pictures, or web/MMAPI images or video. For more information on embedding BlackBerry multimedia in your application, refer to (MM Category link).

Using BlackBerry Phone and Messaging APIs in your application


You can use specific BlackBerry packages to extend your applications so users can send and receive phone calls and messages. To invoke the Phone API from your application, use one of the following methods: invoke.InvokeApplication, which is shown in the above sample code for "Invoking BlackBerry Device Software applications"; and initiateCall(int lineId, String dest), where lineId is the source line ID, and dest is the phone number you want to call.

Alternatively, you can implement PhoneListener to set your application to automatically trigger Phone API features based on events.

Click here for a code sample that implements the PhoneListener interface.

Click here for a code sample that implements the PhoneListener interface.

Copyright 1999-2008 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Copyright 1993-2003 Sun Microsystems, Inc. 901 San Antonio Road, Palo Alto, California, 94303, U.S.A.
Copyright 2002-2003 Nokia Corporation All Rights Reserved.
Java is a trademark or registered trademark of Sun Microsystems, Inc. in the US and other countries.