How to determine the height of the display on Blackberry touch devices?

I am trying to determine the vertical display size of my Blackberry Storm 2.

I know my device has a height of 480 pixels. I am trying to get this value in my code, but if the virtual keyboard is shown, I get a value of 480 - (virtual keyboard height) . Is there any function for determining the real display height on any device (with or without a keyboard with the virtual keyboard turned on or off).

Im also opening RIM classes:

I get these values ​​with a hidden virtual keyboard:

Display.getWidth(); //360 Display.getHeight(); //480 UiApplication.getUiApplication().getActiveScreen().getContentWidth(); //360 UiApplication.getUiApplication().getActiveScreen().getContentHeight(); //480 UiApplication.getUiApplication().getActiveScreen().getWidth(); //360 UiApplication.getUiApplication().getActiveScreen().getHeight(); //480 UiApplication.getUiApplication().getActiveScreen().getVirtualWidth(); //360 UiApplication.getUiApplication().getActiveScreen().getVirtualHeight(); //480 UiApplication.getUiApplication().getActiveScreen().getVisibleWidth(); //360 UiApplication.getUiApplication().getActiveScreen().getVisibleHeight(); //480 

I get these values ​​with the virtual keyboard shown:

 Display.getWidth(); //360 Display.getHeight(); //248 UiApplication.getUiApplication().getActiveScreen().getContentWidth(); //360 UiApplication.getUiApplication().getActiveScreen().getContentHeight(); //248 UiApplication.getUiApplication().getActiveScreen().getWidth(); //360 UiApplication.getUiApplication().getActiveScreen().getHeight(); //248 UiApplication.getUiApplication().getActiveScreen().getVirtualWidth(); //360 UiApplication.getUiApplication().getActiveScreen().getVirtualHeight(); //248 UiApplication.getUiApplication().getActiveScreen().getVisibleWidth(); //360 UiApplication.getUiApplication().getActiveScreen().getVisibleHeight(); //248 

Is there a way to determine the actual height of the screen?

+6
screen screen-resolution blackberry
source share
1 answer

I would also like to know a workaround

In the meantime, you can save the display size for different devices and get them depending on DeviceInfo.getDeviceName ()

Or you can save the value of Display.getHeight () when the application starts

+5
source share

All Articles