Help Center
Local Navigation
- Working with multimedia in a BlackBerry device application
-
Creating a BlackBerry device application that plays media
- Create a BlackBerry device application that plays media
- Code Sample: Playing media from a URI
- Code sample: Playing a sequence of tones
- Create a BlackBerry device application that plays media from an input stream
- Create a BlackBerry device application that plays streaming media
- Play a video in a UI field in a BlackBerry device application
- Create a BlackBerry device application that takes a photograph using the camera
- Create a BlackBerry device application that sends audio to a Bluetooth enabled device
- Create a Content Handler application that plays media
- Code Sample: Create a Content Handler application that plays media
- Specifying the features of a BlackBerry device application that plays media
- Responding to user input
-
Streaming media in a BlackBerry device application
- RIMM streaming video file
- RIM proprietary video format (RIMM streaming file)
- Buffer and play streamed media
- Code sample: Streaming media in a BlackBerry device application
- Code Sample: Reading data from a buffer
- Code Sample: Streaming media from a file on the BlackBerry device
- Code sample: Parsing a RIMM streaming video file
- Recording media by using a BlackBerry device application
- Playing media in the BlackBerry device media application
-
Creating a BlackBerry device application that plays media
- Working with images from the camera application
- Drawing and positioning images
- Displaying images
- Using unprocessed images
- Using encoded images
- Using SVG content in a BlackBerry device application
- Creating 2-D and 3-D graphics by using JSR-239
- Glossary
- Provide feedback
- Document revision history
- Legal notice
BlackBerry Manuals & Help
>
Documentation for Developers
>
Java Development Guides and API Reference
>
Multimedia - Development Guide - BlackBerry Java Application - 5.0
Respond when a BlackBerry device user presses a volume key
-
Import the required classes.
import net.rim.device.api.ui.Screen; import net.rim.device.api.system.Characters;
- Create a class that extends the Screen class.
-
Override
Screen.keyControl().
protected boolean keyControl(char c, int status, int time) { -
Identify the volume key that the
BlackBerry device user changes.
if (c == Characters.CONTROL_VOLUME_UP) { } else if (c == Characters.CONTROL_VOLUME_DOWN) { }Note: In the net.rim.device.api.media.MediaKeyListener class, the keyDown(), keyRepeat(), and keyUp() methods are invoked with Keypad.KEY_VOLUME_UP and Keypad.KEY_VOLUME_DOWN, which proves finer-grain control compared to using keyChar().