Files in the sample application

File name

Description

SendMediaDemo.java

This file contains the entry point for the application and contains the method register(), which specifies the content handler's properties and registers the sample application as a content handler with the Registry.

This file also contains the implementation of the RequestListener interface. The implementation is just the single method, invocationRequestNotify(), which is invoked when an invoking application (such as the camera application) sends an Invocation event to the sample application. This method retrieves the request, checks whether the file to be opened is an image or a video file and calls the appropriate helper method to open the file.

This file contains helper methods to display the image or video file that the invoking application selects.

SendMediaDemo_autostartup.jdp

This project file specifies that the sample application starts running when the BlackBerry® device is turned on and that the sample application must register itself as a content handler.

To do this, the project file also specifies that the String "startup" will be passed to the main() method of the sample application when the BlackBerry device is turned on. The sample application's main() method checks if this String has been passed in and, if it has, invokes the register() helper method.