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
zcox
Posts: 3
Registered: ‎07-06-2009
My Device: Not Specified

ControlledAccessException from getSnapshot

I followed this knowdge base article exactly to create an app with an embedded camera field:

 

http://www.blackberry.com/knowledgecenterpublic/livelink.exe/fetch/2000/348583/800332/1089414/How_To...

 

It works perfectly in the 4.6+ simulators. But when I build & sign using the 4.6 JDE and install on a real 4.6 device, I get a ControlledAccessException when calling the getSnapshot() method when taking the picture.  Here's what ends up in the event log:

 

Name: ControlledAccessException
GUID: 9c3cd62e3320b498
Time: Jul 15, 2009 14:49:55
No detail message
net_rim_bb_camera-2
 CameraPlayer
 getSnapshot
 0x8F0

 

This is the line of code from the article that throws that exception:

 

byte[] imageBytes = vc.getSnapshot(imageType);

 

Does anyone know why we'd be getting a ControlledAccessException here?  We sign our app and use lots of other restricted parts of the API that require signing, and they all work fine.

Please use plain text.
Developer
Developer
CMY
Posts: 1,122
Registered: ‎02-10-2009
My Device: 8130 / 8350 / 9530 / 9550 / 9850 / PlayBook
My Carrier: Verizon

Re: ControlledAccessException from getSnapshot

You have to set the application permissions to allow access to the camera on a real device.
Please use plain text.
New Developer
zcox
Posts: 3
Registered: ‎07-06-2009
My Device: Not Specified

Re: ControlledAccessException from getSnapshot

How do we set those application permissions?
Please use plain text.
Developer
Developer
CMY
Posts: 1,122
Registered: ‎02-10-2009
My Device: 8130 / 8350 / 9530 / 9550 / 9850 / PlayBook
My Carrier: Verizon

Re: ControlledAccessException from getSnapshot

You cannot set them for the user. But you go to options > advanced > applications > BB Menu > change permissions
Please use plain text.