09-10-2008 11:16 AM
Hi all,
I'm brand new to blackberry development and would like to begin with a project. I'd like to be able to programmatically set the security options available on a Blackberry Pearl 8100 without relying on a BES server. Preferrably the ones found under Options->Security Options->General Settings. I've been reading the ITpolicy class via this link:
http://www.blackberry.com/developers/docs/4.0.2api
It indicates that the policy options can be read, but I'm unsure if there's a way to set/change a policy option using the class.
The other alternative that I've found is via the EventInjector class found via this link:
http://www.blackberry.com/developers/docs/4.0.2api
It looks like it could be possible via this method, but I would think it could get messy using wheel movements, especially when a user's icons could be located in different areas. Also, the security of the device would need to be manually loosened on the BB to allow EventInjections to occur.
Does anyone have any suggestions or ideas that could point me in the right direction? If this is possible, any example could would be greatly appreciated.
Thanks!
09-10-2008 11:21 AM - edited 09-10-2008 11:25 AM
I'm not sure if or how you can change those global settings, but any programmatic method which might exist will almost certainly rely on your application having permission to modify the device settings. You can do this by...
ApplicationPermissionsManager appPermMan =
ApplicationPermissionsManager.getInstance();
ApplicationPermissions myPerms = appPermMan.getApplicationPermissions();
myPerms.addPermission(ApplicationPermissions.PERMISSION_CHANGE_DEVICE_SETTINGS);
boolean result = appPermMan.invokePermissionsRequest(myPerms);
Check the result variable for whether your request was successful (ie whether the user clicked yes on the popup screen that the invokePermissionsRequest() call causes).
Edit: doing it with Event Injection will be very hairy, and liable to completely break if the layout of the screen is ever changed in a future OS version. Do that only as a very very last resort.
09-10-2008 04:35 PM
09-11-2008 10:20 AM