con_9
con_9

Reputation: 2511

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

    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. 

Upvotes: 1

Views: 365

Answers (1)

Eric Giguere
Eric Giguere

Reputation: 3505

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.

Upvotes: 1

Related Questions