开发者

BlackBerry "local content" permission popup opening file

I have a BlackBerry app which creates a file on internal flash memory and reads it time and again. I installed the signed app on the device, but whenever I launch the app I get the following error:

The Application text has attempted to open local content, would you like to allow this?

Now I do not want to user to press "yes" again and again, as it is really frustating -- my app accesses the file multiple times so there are multiple prompts.

I have posted one solution below. But this is not an acceptable solution. I cannot ask the user to enable and disable firewall repeatedly as he goes online and offline. Is there a better solution? I am using BlackBerry OS 4.5

 开发者_Python百科   unacceptable solution:
    Work around:
    If I want to use offline mode, i have to turn firewall enabled:
    1. Turn on the firewall (Options > Security > Firewall > Enabled)

    For online mode, turn firewall disabled:
    1. Turn off the firewall (Options > Security > Firewall > Disabled)
    2. When I run my application, there will be only one pop-up asking for 
       permission to connect,allow it. 


What you can do is have your app check to see if it has the right permissions on startup and prompt the user to set the permissions, either temporarily or permanently. See the ApplicationsPermissions.invokePermissionsRequest method. There's also a good asking for permissions tutorial that shows how to do it.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜