
Multimedia
Enhancements to the BlackBerry® APIs enables you to embed a viewfinder, record video clips, and play back captured video. You
can also create a BlackBerry device application that can respond to key presses of media keys even when the application is in
the background. New methods are also available to compare Bitmap images to find partial differences, and to scale Bitmap
images.
Media key event access
You can access media key events on a BlackBerry® device by using the Media Key API that is provided in the
net.rim.device.api.media package. For example, when a user presses a volume key on the BlackBerry device, your
application can respond and increase or decrease the volume accordingly.
You can access media key events while your application is in the background by implementing the MediaActionHandler
interface and registering your application by invoking Application.addMediaActionHandler(). For example, your
application can respond when the user presses the Mute key while the user is using another application on the BlackBerry device.
Your application can access media key events only if the application on the top of the application stack is not registered to listen
for the media key events. If multiple applications that are running in the background are registered to listen for media key events,
the application that is closest to the top of the application stack receives the media key event.
MIDlet applications can access media key events by using extensions that are provided in the
net.rim.device.api.lcdui.control package.
To download a sample application that demonstrates how to use the Media Key API, visit www.blackberry.com/go/
mediaplayerdemo. For more information about media keys, see the BlackBerry Java Application Multimedia Development
Guide and the API reference for the BlackBerry® Java® Development Environment.
Feature and Technical Overview
Multimedia
12
Komentáře k této Příručce