Accessing restricted functionality

BlackBerry PlayBook tablets can capture rich information from their environment, via the GPS receiver, a microphone, and so on.

To help protect against potentially malicious code, users must grant your application access to the functionality. If your app uses APIs that access restricted functionality, and it does not request access to a device capability, the APIs will return errors. For example, if you attempt to access a file in a shared folder without the access_shared capability, you will get a "permission denied" error on open. Your app must handle these errors gracefully.

You must specify the device capabilities required for your application by adding one action element per device capability to the project's BAR application descriptor file. For more information about creating a application descriptor file, see "Set capabilities for bar-descriptor.xml" in the IDE User's Guide.

The following are values for the action element. You can use these values to specify the capabilities that are required by your application:

Set this value: If you need access to:
access_internet use internet connection from a WIFI, wired, or another connection to a non-local destination
access_led_control control the LEDs on the device
access_shared read and write files that are shared between all applications that are run by the user
play_audio play an audio stream
post_notification post a notification to the notification area of the screen
read_device_identifying_information discover device unique identifiers such as the PIN and serial number
read_geolocation read the current location of the device
record_audio the audio stream from the microphone on the device
set_audio_volume change the volume of an audio stream that is being played
use_camera the data coming from one of the cameras on the device