List of all Iphone and Blackberry Development codes in a one click Iphone,objective C,xcode,blackberry Development,iOS Development

Thursday, March 28, 2013

Application Permissions in Blackberry

BlackBerry Enterprise Server administrators can control the data and APIs that BlackBerry Java Applications can access on BlackBerry devices, and the external data sources and network connections that BlackBerry Java Applications can access by using application control policies. For example, administrators can use application control policies to prevent users from installing an application on a BlackBerry device.
Application control policies enable administrators to perform the following actions:
  • prevent users from installing and running applications on BlackBerry devices
  • limit internal connections (connections behind a firewall)
  • limit external connections
  • limit local connections (serial, infrared, and USB connections)
  • limit access to the key store
  • limit access to particular APIs

You can determine whether an API is available for use on a BlackBerry device and request that the user change permissions, if necessary. In the following code sample, the application checks whether the application control settings permit access to location-based services. If the API is unavailable, the application prompts the user for permission to use this API.

ApplicationPermissionsManager appPermMgr = 
ApplicationPermissionsManager.getInstance();

// Query the Location permission
int locationPermission = appPermMgr.getPermission( 
ApplicationPermissions.PERMISSION_LOCATION_DATA );
        
if( locationPermission != ApplicationPermissions.VALUE_ALLOW ) {

    // Build the permission request
    ApplicationPermissions requestedPermissions = 
        new ApplicationPermissions();

    requestedPermissions.addPermission( 
        ApplicationPermissions.PERMISSION_LOCATION_DATA );

    // Invoke the request, the system takes over            
    appPermMgr.invokePermissionsRequest( requestedPermissions ); 
}
 

2 comments:

  1. Thanks for sharing such a valuable information. Blackberry Smartphones are used throughout the world and this blog enlighten some of the important facts about Blackberry App Development.

    ReplyDelete