Display.screenshot cause ControlledAccessException

I developed an application that involves taking screen shots, using the Display.screenshot () method. It works very well in the Simulator, but I just tried to start a 8120 unit, and a ControlledAccessException is thrown by the method of screenshot. Cod files are signed with keys of the RIM and the device works OS 4.3.0.94, then as far as I can see that the method must be available. I get a lot of messages from the device by not saying "No sig 0 x 33" but as far as I know who is an in-house code of RIM signing key so I don't think that has anything to do with it. Does anyone know why it does not work on the device, but on the Simulator?

You should check the effective permissions on the device.  Some of them may default on refuse, even if the application is signed.  This is because they represent a significant security risk on the device, event Injection (injection of keys) is one and so is browser filtering.  This may also be true for the screenshot on some devices.

To check this setting for your application, go to Options-> advanced-> application Options and look for your application.  Once you find your app click menu and change the permissions.  Make sure of course not of them are defined on refuse, specifically screenshot under Interactions.

Tags: BlackBerry Developers

Similar Questions

  • Display.screenshot does not behave as expected

    Hello

    The Display.screenshot method doesn't seem to work as expected. When I call this method, I got the dialog box asking the user or not to allow a screen capture to take. If the user selects Hello but leaves theDo ask not agai box unchecked, the screenshot is not taken. If, however, select 'allow' and check the box "Do not ask again" the screenshot is taken. Maybe that's a problem with the dialog box?

    Here is my code below-
    try {}
    Display.screenshot (this.bitmap, 0,0, Display.getWidth (), Display.getHeight ());
    }
    /**
    * If the user does not have a screen capture taken just display the General image
    */
    {} catch (ControlledAccessException cae)
    This.Bitmap = Constants.BACKGROUND_IMAGE;
    }

    Depends on how you code.

    Personally I d code it as follows:

    (a) have an indicator of persistent screenshot with three States

    0 - does not define

    -1 can't screenshot

    1 is allowed to the screenshot.

    Check this box if you are about to make a screenshot.  In this case - 1 indicate to the user that they have disabled this function be selected permissions.  If it's 0 or + 1, check the permissions API to see if you are allowed to do.  If you are, then set the value to 1 and do.  If you're not, tell them that they need to enable and display the permissions API.  When that is saved, check again.  If they helped him, set the indicator 1 and continue.  If they don't have not enabled it, it the value - 1 and tell them that you can't capture screens because they were disabled.

    Not sure which covers all cases, but you get the idea.

    Ok?

  • Upcoming context menu in the screenshot using Display.Screenshot

    Hi all

    I have a Menu item. When click on that I take screenshot, but I also get the context menu in the screenshot. I want only the screenshot to the screen behind the context menu.

    Pointers for this?

    Thanks in advance,

    Sandeep

    Thanks for you answers.

    I tried to have the timer also option to wait for a while before taking screenshot didn't work.

    Then I tried after option, it worked. I've added a call to repaint before taking a screenshot. Is this a good method to do?

    // Added this line before taking screenshot UiApplication.getUiApplication().repaint();
    Display.screenshot(bitmap,0,0,Display.getWidth(),Display.getHeight());
    

    I'll also explore the options mentioned by you.

    Thank you

    Sandeep

  • How close or minimize the menu box using Display.screenshot ()?

    Hello

    Did someone help out me in finding what way I can minimize or close the menu box while I take the screenshot of any screen?

    The problem is when I select the menu item Printscreen, the Display.Screenshot () method runs, and it takes the screenshot including the menu box that I opened for the selection of the menu-item (Printscreen).

    So, how to remove that box of Menu before you take the screenshot?

    Please answer

    Thank you.

    You might find some useful options in this thread;

    http://supportforums.BlackBerry.com/T5/Java-development/context-menu-coming-in-screenshot-by-using-D...

  • Display.screenshot (bitmap) returns white screen

    Hi all

    I develop an application that uses the camera (VideoControl and player).

    Here I am pasting my code

    String encoding = "encoding = video/3gpp & mode = standard;
    _player = Manager.createPlayer ("capture://video?" + coding);
    _player. Realize();

    _videoControl = (VideoControl) _player.getControl ("VideoControl");
    If (_videoControl! = null) {}
    Field videoField = _videoControl.initDisplayMode (Field) (VideoControl.USE_GUI_PRIMITIVE, "net.rim.device.api.ui.Field");
    Add (videoField);
    btnStart = new ButtonField ("Get Snap", ButtonField.CONSUME_CLICK |) ButtonField.FIELD_HCENTER);
    Add (btnStart);
    _videoControl.setVisible (true);
    btnStart.setChangeListener (this);
    _player. Start();
    }

    On the click event of a btnStart buutonField I call it

    public void fieldChanged (field field, int x) {}
    Bitmap bmp = null;
    VerticalFieldManager vfmMain = new VerticalFieldManager)
    VerticalFieldManager.VERTICAL_SCROLL | VerticalFieldManager.VERTICAL_SCROLLBAR);
    While (snapCounter< 20)="">
    BMP = new Bitmap (Display.getWidth (), Display.getHeight ());
    Display.screenshot (BMP);
    vfmMain.add (new BitmapField (bmp));
    BMP = null;
    snapCounter ++;
    Thread.Sleep (100);
    }
    }

    bitmap HE I includes the pictures seen in the camera too.

    But it works fine when I run the application for the first tiem after installing it in the appliance.  When I get out the request and re-launch it he gives screen but without the camera images.  I want the image with the images of the camera.

    Please, someone knows why it's happening. And is there a solution for this.

    Thank you

    For this best prectice is to use the playerListener and overrride method.

    ' Public Sub playerUpdate (player pl, event of the string, eventData object) {}
    try {}
    I have if (event.equals (PlayerListener.STOPPED)) {}
    close the player
    _player. DEALLOCATE();
    _player. Close();
    } else {if (event.equals (PlayerListener.CLOSED))
    write your meeting
    }
    }
    } catch (Exception ex) {}
    System.out.println ("playerUpdate Exception" + ex.toString ());
    }
    }

    This works well.

    Now whenever it gives the page... with video...

  • Display.ScreenShot

    I capture the screenshot and save it to the memory of handsets. But the image size is 0 bytes in size and when I open the image, a red x appears on the top left corner of the screen.

    try convert image in bytes as:

    PNGEncodedImage png = PNGEncodedImage.encode (screenshot);
    final byte [] b = png.getData ();

    If (b! = null) {}
    try {}
    FileConnection dirConn = (FileConnection) Connector.open (filePath, Connector.READ_WRITE);
    If (! dirConn.exists ())
    dirConn.mkdir ();

    dirConn.close ();
    } catch (Exception ex) {}
    ex.printStackTrace ();
    Dialog.Alert ("unable to download the file");
    return;
    }
    String fileNm = filePath + file name;
    try {}
    FileConnection conn is Connector.open (fileNm, Connector.READ_WRITE) (FileConnection);.

    If (conn.exists ()) {}
    Conn.Delete ();
    Conn.Create ();
    } else {}
    Conn.Create ();
    }

    conn.setWritable (true);
    OutputStream out = conn.openOutputStream (0);

    If (conn.canWrite ()) {}
    out. Write (b, 0, b.length);
    out. Flush();
    out. Close();
    Conn.Close ();
    Dialog.Alert ("the saved Image");
    NUM ++;
    }
    } catch (IllegalModeException e) {}
    System.out.println ("IllegalModeException taking in the createFile method");
    e.printStackTrace ();
    } catch (SecurityException e) {}
    without the permission of ' t create/write
    System.out.println ("SecurityException caught in createFile method");
    e.printStackTrace ();
    } catch (IOException e) {}
    System.out.println ("IOException caught in createFile method");
    e.printStackTrace ();
    } catch (Exception e) {}
    System.out.println ("commissariats taken:" + e);
    }
    } else {}
    Dialog.Alert ("file loading error");
    return;
    }
    System.out.println ("* Bitmap pixel:" + bitmap.getBitsPerPixel ());
    System.out.println ("* Bitmap height:" + bitmap.getHeight ());
               
    }
    };

  • Horizon view Agent 6.0.2 Windows 8.1 desktop - size setting display scale causes mouse which will be pasted in the top left corner

    Hello

    I am having some problems when I try to adjust the size to the scale option in the Virtual Office Windows 8.1 with view agent 6.0.2. When I try to change the scale via Control Panel -> display -> option to change the size of all the items ( view failover control settings is disabled by VMware KB: Settings tab is not available in the display panel of a Horizon view desktop locally when t...). After that, the mouse pointer gets suddenly blocked until the upper-left corner, and I'm unable to move the mouse pointer on this corner that the mouse pointer continues new jump in him. When I change the scale to the original (use the keyboard to change the setting), the behavior of mouse pointer returns to normal.

    Anyone else having this problem?

    Found the solution by adding a registry entry:

    Location: HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Teradici\PCoIP\pcoip_admin_defaults

    Name: pcoip.disable_cursor_jumping

    Type: REG_DWORD

    Data: 1

    After that it is defined on the parent image and recomposed (or reboot if you want to set this on a persistent desktop computer), there is no more mouse pointer jumps after changing the scale of the fonts/AC.

    This was indeed listed in KB here — not exactly the problem listed in the KB, but it is quite similar:

    http://KB.VMware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalID=2060701

  • [PROBLEM] Cannot open my Skype program and connect. A bizarre version of plain html is displayed. (screenshot)

    That's what it appears to be:

    Please help, thnks!

    What you see is due to non-standard settings for the .css class in your Windows registry. You can solve this problem with a few simple steps:

    http://community.Skype.com/T5/Windows-desktop-client/Skype-issue/m-p/2126425#M204784

    See also this:

    http://community.Skype.com/T5/Windows-desktop-client/cannot-login-on-Skype/m-p/2960379#M237663

  • Satellite Pro A100-080: NVidia display driver's break in 3D games

    Hello

    I have some problems with the display driver since I bought the laptop 9 months ago. I tried to install each new driver published on the toshiba site but no driver is running stable on my system.

    The problem is that my laptop crashes with blue screen when playing 3d games and my windows vista tells me that it is the display driver causing accidents.

    I had the previous version of the driver installed several months ago and I think it's more stable than the current version. Unfortunately I lost the files for that one, but I prefer a functional driver for this laptop.

    My laptop
    Satellite Pro A100-080
    Modelno. PSAASE-00G004GR
    Made on 2007-02-20

    Thank you all in advance using the year

    bgrds
    Robert

    Hello, Robert

    Can you please tell us what games do you play on Vista? Do you play games designed for Vista or older games from Windows XP Home edition?

  • Screenshot on the torch

    Hello

    If I use this code to capture a screenshot on an OS 6 Toch:

    Display.screenshot(bmp);
    

    Then it works perfectly in vertical mode, but when I turn the camera in landscape mode and take a screenshot, then it gives me an illegalargumentexception. don't someone here on this?

    You create a new Bitmap every time? The dimensions are set correctly for the bitmap when you turn? In addition, there should be a message to the Exception, what is?

  • Convert Image screenshot of Bitmap file?

    I use code below to take the screenshot of Blackberry.

    public static Bitmap getScreenShot() {}
    Bitmap bitmap;
    image bitmap = new Bitmap (Display.getWidth (), Display.getHeight ());
    Display.screenshot (bitmap);
    try {}
    FileConnection file = (FileConnection)Connector.open("file:///store/home/user/img.bmp");
    {if(!file.) Exists())}
    leader. Create();
    }
    DataOutputStream out = file.openDataOutputStream ();
    out. Write (getBytesFromBitmap ());    Returns the bytes of the bitmap object
    } catch (IOException e) {}
    Generative TODO catch block
    e.printStackTrace ();
    }
    return bmp;
    }

    I want to convert this Bitmap object in a file of any format of file:.bmp/.png/.jpg etc. Is there a way I can achieve this?

    Help, please.

    Thank you.

    to solve this... I was without closing my outputstream...

  • Screenshot method

    Hi all

    I use the following code to capture screen:

    Bitmap image = new Bitmap( 64, 64 );                             Display.screenshot( image, 0, 0, 64, 64 );
    

    I then use:

    image.getType () which returns 197: ROWWISE_16BIT_COLOR

    But if I had to use

    Bitmap image = new Bitmap( 64, 64, Bitmap.ROWWISE_16BIT_COLOR );Display.screenshot( image, 0, 0, 64, 64 );
    

    He throws an IllegalArgumentException saying that is not supported

    Can someone explain this?

    Certainly if the created image is going to be a ROWWISE_16BIT_COLOR, then you can create a bitmap image in ROWWISE_16BIT_COLOR for the screenshot to use?

    According to the documents of the developer, the first parameter is the type where you should type and not in the last...

    Bitmap(int type, int width, int height)
    

    Given that the first parameter is 64, it shows that there is an illegal argument...

    See you soon...

  • I would get prominent display Btmap in a background application

    With JDE 4.5 I would read the Bitmap of the actual request screen and copy it to an image object to maintain and restore it later.

    I'm doing it in separate tread of tha request. So far, just found routiens to write on the screen, but don't not read.

    Display.screenshot

  • Screenshot using touchscreen devices

    Hello friends,

    I and requirement to capture the screenshot of blackberry. I can do this using the class net.rim.device.api.system.Display as follows:

    Bitmap screenBitmap=new Bitmap(Display.getWidth(),Display.getHeight());
    Display.screenshot(screenBitmap);
    

    But in the case of devices with touchscreen when the on-screen keyboard is visible the code above only takes the screenshot of the screen above the on-screen keyboard and not to take the screen shot of the on-screen keyboard.

    So I ask your valuable comments on how I can get the screenshot of the full screen, including the on-screen keyboard when it is visible.

    Thanks and greetings

    Ludovic P

    Hello Michael, thank you very much, the code you posted has worked perfectly

    I've never looked on this method.

    Thanks a lot again

  • Copy a screenshot in a Bitmap image does not work on a device

    I have developed a program that creates a Bitmap and copys a screenshot inside.

    This works on the 8820 Simulator, but not on firmware 8820 4.5.0.37.

    It throws the exception on the device. I think I need to know what kind of Bitmap must be created before you take the screenshot. There's a Constuctor Bitmap with a type parameter. Do I need to use it to create the correct Bitmap?

    Following is the screenshot:

    Bitmap TheBitMap = new Bitmap (Display.getWidth (), Display.getHeight ());
    Display.screenshot (theBitMap);

    Thank you Jürgen

    I rebooted the BlackBerry, deleted and reinstalled the application.

    Then the Exception disappears so the problem just magically disappeared.

Maybe you are looking for