How to give blackberry application all the available permission?

跟風遠走 提交于 2019-12-10 17:25:56

问题


I'm developing using JDE 4.5 which doesn't contain the PERMISSION_RECORDING, and it's denied by default in 4.6 and higher devices.

So I want my application to have this permission or all the possible permissions that it can get.

Thanks in advance.


回答1:


You can't set app permissions pro grammatically. What you can do is force Request Permission dialog to appear, see How to - Display custom messages in the request permission dialog

So what you can do is do some test recording on application startup, then Request Permission dialog will come up. It would come up anyway, but on startup this will be more in place, and more, you can set your own message text there.

UPDATE
If permission is set to Deny than there will be no Promt Dialog on denied action.
Then you can use ApplicationPermissionManager to invoke permission request:

ApplicationPermissionsManager manager = ApplicationPermissionsManager
    .getInstance();
int current = manager
    .getPermission(ApplicationPermissions.PERMISSION_SCREEN_CAPTURE);
if (current != ApplicationPermissions.VALUE_ALLOW) {
    ApplicationPermissions permissions = new ApplicationPermissions();
    permissions.addPermission(ApplicationPermissions.PERMISSION_SCREEN_CAPTURE);
    manager.invokePermissionsRequest(permissions);
}


来源:https://stackoverflow.com/questions/1699873/how-to-give-blackberry-application-all-the-available-permission

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!