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
New Developer
mrmarkwang
Posts: 27
Registered: ‎08-26-2008
My Device: Not Specified

cannot read the device memory file?

I just do some tests:  try to read a file from my device in /store directory.

I know it's readonly,. But i found the file cannot be even read, is that right?

 

when I use a InputStream to try read it:

inputStream = fileConnection.openInputStream();

 

there will have a Exception:

net.rim.device.api.system.Controlled.AccessException

New Developer
mrmarkwang
Posts: 27
Registered: ‎08-26-2008
My Device: Not Specified

Re: cannot read the device memory file?

It's wired that file cannot be read.
BlackBerry Development Advisor
MSohm
Posts: 14,753
Registered: ‎07-09-2008
My Device: BlackBerry Passport

Re: cannot read the device memory file?

A ControlledAccessException indicates that the application does not have permission to perform the action. 

 

An application can request a permission change using the ApplicationsPermissionsManager class.  A user can change these settings by going to Options, (Advanced Options), Applications, selecting the application in the list and using the Edit Permissions menu entry.

Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker
Developer
martijnbrinkers
Posts: 155
Registered: ‎02-18-2009
My Device: Not Specified

Re: cannot read the device memory file?

It's an old thread but I have similar problems. If I try to open a file from the system store outside of my home store (for example /store/samples/ringtones/Alarm_....) I always get a ControlledAccessException. I have enabled all the available application permissions (by settings the application permissions using Advanced Options etc.). I can open a file from the home store without any problems. I experience the same problem on a pearl 8120 and on a 8700g (upgraded to OS4.5). Any idea?
Developer
johnbibs
Posts: 905
Registered: ‎02-07-2009
My Device: BlackBerry Torch 9800

Re: cannot read the device memory file?

Maybe your device is in Mass Storage mode? if it is, you cannot access the Media card when it is in that mode. :smileyhappy:
Developer
martijnbrinkers
Posts: 155
Registered: ‎02-18-2009
My Device: Not Specified

Re: cannot read the device memory file?

No it happens when it's not connected. I don't have problems accessing the SDCard only the sytem memory.
BlackBerry Development Advisor
MSohm
Posts: 14,753
Registered: ‎07-09-2008
My Device: BlackBerry Passport

Re: cannot read the device memory file?

[ Edited ]

Third party applications are not able to access to bundled media files (sample ringtones, backgrounds, etc..).

 

Are you able to access files you have added yourself?

Message Edited by MSohm on 10-07-2009 01:38 PM
Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker
Developer
martijnbrinkers
Posts: 155
Registered: ‎02-18-2009
My Device: Not Specified

Re: cannot read the device memory file?

You are right. The sample files cannot be accessed. I can open my own files (although I cannot write to the samples dir but that's excpected behavior).