06-03-2013 03:18 PM
I'm having an ussue with the screen_create_context() function. When I give it the flag SCREEN_APPLICATION_CONTEXT, the program works but returns the incorrect contexts. However, the original code calls for SCREEN_DISPLAY_MANAGER_CONTEXT to be used like this:
and returns -1 (0 displays available/crashes the app). The code I took it from can be found here. I'm wondering why I can't access the device displays (root priveledge issue?). Any thoughs?
Solved! Go to Solution.
06-03-2013 03:33 PM
According to API documentation https://developer.blackberry.com/native/reference/
What do you mean by 'returns the incorrect contexts'?
06-03-2013 03:45 PM
I wonder why SCREEN_DISPLAY_MANAGER_CONTEXT is in the code then...
In any case, SCREEN_APPLICATION_CONTEXT returns the software windows, while SCREEN_DISPLAY_MANAGER_CONTEXT returns the hardware display devides, internal and external. I use multiple windows in my code and I need the entire phone phone screen as a whole (as seen by the user), regardless of which windows are present.
From the screen_read_display() page: "You need to be working within a privileged context so that you have full access to the display properties of the system. Therefore, a context which was created with the type SCREEN_DISPLAY_MANAGER_CONTEXT must be used."
06-14-2013 04:52 PM
Your app is not the display manager. this is restricted to privileged software - eg. the Navigator.
screen_read_display() is restricted for a good reason.
There is a security-aware screenshot API coming in the 10.2 release, so wait for that.
screen_read_window() can be used to screenshot your own app though.