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 Contributor
MarioPalos
Posts: 8
Registered: ‎03-23-2012
My Device: Torch 9800
Accepted Solution

Blank PNG when i try to take a screenshot of my app

Hi, 

I used this code as example to add a "take screenshot" feature to my app:
http://supportforums.blackberry.com/t5/Java-Development/Capture-and-save-a-screen-shot/ta-p/445212

But everytime i test it, it only creates a Blank.png file.

I tried a  lot of different combinations, tried to put the class and the function in different files, call the functions from different parts of the code, but nothing seems to happen.

I'm using the VGField  Class, Do you think this might be the problem?
What other options do i have to take a screenshot?

Thank you all!!
 

Please use plain text.
Developer
alishaik786
Posts: 285
Registered: ‎08-26-2011
My Device: 9900

Re: Blank PNG when i try to take a screenshot of my app

This link helps you:

 

save ScreenShot image in a folder in blackberry

 

In this link you will get:

1st Post gives that capture an image from camera and show it in bitmap;

2. capture an image like screen shot; and save it in SDCard;

=================================================================================
Feel free to click LIKE button if the solution helps you;
--
Regards,

ALI SHAIK.
Please use plain text.
New Contributor
MarioPalos
Posts: 8
Registered: ‎03-23-2012
My Device: Torch 9800

Re: Blank PNG when i try to take a screenshot of my app

Dear alishaik786, thanks for the useful link.
I checked the code and it was quite useful, but still i'm not able to do what i  need/want.

I want the user to be able to take a screencapture / screenshot  of the application. With the code of the link I posted, the application "takes the screenshot" (even ask you to give the permissions), but the image it saves is a blank png file insted of the image of the application.

Anyway, thank you for helping and for the time you took to read/answer 

Please use plain text.
Developer
peter_strange
Posts: 19,608
Registered: ‎07-14-2008
My Device: Not Specified

Re: Blank PNG when I try to take a screenshot of my app

I might be wrong here, but I believe if you take a screen shot, and the user has not authorized your application for screen shots, you will get a blank Bitmap and the user will be prompted to allow it.  the next screen shot will work, assuming the user has allowed it and is not asked again.  So try doing it twice!

 

Does your code work on the Simulator? 

Please use plain text.
New Contributor
MarioPalos
Posts: 8
Registered: ‎03-23-2012
My Device: Torch 9800

Re: Blank PNG when I try to take a screenshot of my app

Dear peter_strange, 

You are correct, it works the second time you take the screenshot!! Thanks for your answer.

The problem i'm having is this:
1) user presses "take screenshot"
2) Message asking for permission pop-UP
2.2) If you choose to "allow" and "dont' ask again" the screenshot starts working perfectly
2.3) If you choose to "allow" but do not select the "dont' ask again" the next screenshots does not work

How do i add the option that the permission is set as soon as the app is installed?
 

Please use plain text.
New Contributor
MarioPalos
Posts: 8
Registered: ‎03-23-2012
My Device: Torch 9800

Re: Blank PNG when I try to take a screenshot of my app

I read a little bit and guess what i need to do is an Application Permissions Manager that pops-up when the application is executed.

Thank you a lot for the information, i'm glad and happy to see the support and share spirit in this community

Please use plain text.
Developer
peter_strange
Posts: 19,608
Registered: ‎07-14-2008
My Device: Not Specified

Re: Blank PNG when I try to take a screenshot of my app

"guess what I need to do is an Application Permissions Manager "

 

Correct, that will get over the 'first' problem.  In addition, if you are  not given permission, then you can withdraw the functionality from the applications.  You may fund that some users don't want to give you permission or can not, because of the corporate direction. 

Please use plain text.
New Contributor
MarioPalos
Posts: 8
Registered: ‎03-23-2012
My Device: Torch 9800

Re: Blank PNG when I try to take a screenshot of my app

Dear peter_stramge, one again Thanks for the advice,

i'll create a "config" archive, saved in the user's smartphone that will save if the user gave or not the permissions required.

when a user that not granted the permissions try to use the screenshot it will pop a message saying that the permissions are not enough to perform the operation.

I think this is ok,
the screenshot is not a primary function of the application, so if the permission is not granted it is not critical. 

Please use plain text.