Determine The Services That Are Available To A Blackberry Java Application; Application Control; Allow A Blackberry Device Application To Request Access To Resources - Blackberry JAVA DEVELOPMENT ENVIRONMENT - - DEVELOPMENT GUIDE Manual

Version: 4.7.0
Hide thumbs Also See for JAVA DEVELOPMENT ENVIRONMENT - - DEVELOPMENT GUIDE:
Table of Contents

Advertisement

Development Guide

Determine the services that are available to a BlackBerry Java Application

The service book consists of service records. Each service record defines a service on a BlackBerry® device. Service records define
the communication protocol (WAP or IPPP), the network gateway, and the configuration information such as the browser settings.
1.
Import the net.rim.device.api.servicebook class.
2.
To let your BlackBerry device application interact with the BlackBerry® Infrastructure, use the service book API
(net.rim.device.api.servicebook).

Application control

The BlackBerry® Application Control IT policy rules provide administrators with the ability to establish the capabilities of an
application when it runs on a specific BlackBerry device. For example, administrators can use the BlackBerry Application Control
IT policy rule to make sure that a game that exists on the BlackBerry device cannot access the phone API. The BlackBerry
Application Control IT policy rule works only when the BlackBerry device is connected to a BlackBerry® Enterprise Server. This
IT policy does not apply to BlackBerry devices that use the BlackBerry® Internet Service only.
If the administrator or a user denies the application access to one of the protected areas, the associated method throws a
ControlledAccessException. For class-level checks, the method throws a NoClassDefFoundError.
Depending on which APIs that you use, your application might need to handle both types of errors.

Allow a BlackBerry device application to request access to resources

1.
Import the following classes:
• net.rim.device.api.applicationcontrol.ApplicationPermissions
• net.rim.device.api.applicationcontrol.ApplicationPermissionsManager
2.
Create an instance of the ApplicationPermissions class.
ApplicationPermissions permissions = new ApplicationPermissions();
3.
Specify the build request to ask for event injection privileges.
permissions.addPermission
( ApplicationPermissions.PERMISSION_EVENT_INJECTOR );
4.
Determine the access control settings that the BlackBerry® device user specifies.
if( ApplicationPermissionsManager.getInstance().invokePermissionsRequest
( permissions ) ) {
System.out.println( "The user saved equal, or more permissive
settings" );
} else {
System.out.println( "The user saved more restrictive settings" );
}
Application control
67

Advertisement

Table of Contents
loading

This manual is also suitable for:

Java development environment

Table of Contents