Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Developer
Posts: 490
Registered: ‎07-16-2008
My Device: Not Specified
Accepted Solution

Local storage access permission problem

Hi guys recently I am developing some application having purpose of storing some images downloaded from internet to the local storage.
So I did some testing on an 8310. On this particular model it kept asking me for permission every time it wanted to access the local storage or the network. It was mildly annoying during normal operation but made the application impossible to use since it asked me for what seemed like every image download. On all of my testing to date (mostly on the 8800 and Perl series) I am able to answer once and give the application permanent security permissions to access the network, GPS, and the local storage.
Is there a way to get the application to force a one time permissions configuration?
Developer
Posts: 168
Registered: ‎11-01-2008
My Device: Galaxy S II
My Carrier: Meteor (Ireland)

Re: Local storage access permission problem

Check out the net.rim.device.api.applicationcontrol package. The ApplicationPermissions and ApplicationPermissionsManager classes in there enable you to get the o/s to ask the user to grant your app the PERMISSION_FILE_API permission and it will remember their decision the next time around. (If I understand your requirement correctly...)

Developer
Posts: 490
Registered: ‎07-16-2008
My Device: Not Specified

Re: Local storage access permission problem

ok thanks, could you please support me some code that used ApplicationPermission class.
Developer
Posts: 146
Registered: ‎11-05-2008
My Device: Not Specified

Re: Local storage access permission problem

For application Permission ,the code is

ApplicationPermissions permRequest =  new ApplicationPermissions();
permRequest.addPermission(ApplicationPermissions.PERMISSION_FILE_API);
ApplicationPermissionsManager.getInstance().invokePermissionsRequest( permRequest );
         

Developer
Posts: 490
Registered: ‎07-16-2008
My Device: Not Specified

Re: Local storage access permission problem

Tnx Man' I got it.