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
malcolm
Posts: 41
Registered: ‎08-01-2008
My Device: Not Specified
Accepted Solution

Display.screenshot causing ControlledAccessException

I've developed an application which involves taking screenshots, using the Display.screenshot() method. It works fine in the simulator but I've just tried to get it going on an 8120 device, and a ControlledAccessException is being thrown by the screenshot method. The cod files are signed with RIM keys, and the device is running OS 4.3.0.94, so as far as I can see that method should be available. I get a lot of messages from the device saying "no sig from 0x33" but as far as I know that is a internal RIM code signing key so I don't think that has anything to do with it. Does anyone know why this is not working on the device but fine on the simulator?
Developer
kzettel
Posts: 120
Registered: ‎07-16-2008
My Device: 9000

Re: Display.screenshot causing ControlledAccessException

You should check the actual permissions on the device.  Some of them may default to Deny even if the application is signed.  This is because they represent a significant security risk to the device, Event Injection (key injection) is one and so is Browser Filtering.  This may also be true for Screen Capturing on some devices.

 

To check this setting for your application go to Options -> Advanced Options -> Applications  and search for your app.  Once you find your app click menu and edit permissions.  Make sure non of these are set to Deny, specifically Screen Capturing under Interactions.

Kurt Zettel | Chief Architect | Metova
www.metova.com
Developer
malcolm
Posts: 41
Registered: ‎08-01-2008
My Device: Not Specified

Re: Display.screenshot causing ControlledAccessException

Ah, great, that sounds like it could do the trick. At the moment my app isn't displayed in the applications menu, I guess that's because I used javaloader to load the cods rather than the desktop manager. I'll try and install it properly from an .alx file and see if that works. Thanks.
Developer
malcolm
Posts: 41
Registered: ‎08-01-2008
My Device: Not Specified

Re: Display.screenshot causing ControlledAccessException

Yes, that did the trick, application is working now. Many thanks for your quick response.
Developer
JChow
Posts: 68
Registered: ‎09-04-2008
My Device: Not Specified

Re: Display.screenshot causing ControlledAccessException

Having exact same problem on a 9000 ( OS v4.6.0.92 )

When tyring to use Display.screenshot() the app will crash and the Log shows a ControlledAccessException.

 

I want to try the same trick, which works fine on 83xx. The only problem is the Screen Capturing Permission ( under Options -> Advanced Options -> Applications ) is no longer available in 4.6

 

Is there any way to trigger that permission on the Bold? or turn it on in the code? 

If the permission is locked that means Display.screenshot() will not be working at all in the latest OS? Is there a replacement method ( to make a screen shot) ? 

 

Thanks

 

 

some additional info:

9000 simulator works fine ( no need to set permission )

83xx series devices work fine ( if setting the permission like suggested by kzettel )

 

 

 

Developer
malcolm
Posts: 41
Registered: ‎08-01-2008
My Device: Not Specified

Re: Display.screenshot causing ControlledAccessException

[ Edited ]

As it happens we've just received our first 9000 devices today at work and I'm also noticing this permission is gone. I've got a few other issues to sort out before I look at actually getting our app to run, but this is certainly a bit disconcerting... that said I'm sure the option will remain and the permission will have been moved somewhere (I see one for recording, maybe this one covers it?). My company has had conference calls with RIM and we will be joining the ISV alliance soon, and our software relies entirely on the screenshot capability, so I'm sure RIM would not have removed it!

 

Edit: yeah, if you check the docs the Screenshot permission has been deprecated and replaced with the Recording one. So no problems here.

Message Edited by malcolm on 09-15-2008 11:17 AM
Developer
JChow
Posts: 68
Registered: ‎09-04-2008
My Device: Not Specified

Re: Display.screenshot causing ControlledAccessException

Yes. you are right. it is the "Recording"

I dont know why my setting change wasn't saved when i did the testing last time.

 

anyhow. Everything is good now. thanks