Device Capability API

You can query the capabilities of a BlackBerry® device by using the Device Capability API that is provided in the net.rim.device.api.system.capability package. You can use the DeviceCapability class to query whether specific features, such as a virtual keyboard or a physical keyboard, are supported on the device, whether the feature is currently available to the BlackBerry device user (for example, if the slider on a device is open and the user can use the physical keyboard), and whether your application can currently access the feature.

For example, DeviceCapability.isVirtualKeyboardAvailable() returns true if the device has a virtual keyboard currently displayed. Otherwise the method returns false.

You can define a listener to notify your application of changes to the specified capabilities of the device by implementing the DeviceCapabilityListener interface.

For an example of how to use the Device Capability API, see Cradle detection.

For more information about the Device Capability API, see the API reference for the BlackBerry® Java® SDK.

Next topic: Cradle detection

Was this information helpful? Send us your comments.