Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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

I know, my device has 480 pixels height. I try to get this value in my code, but if virtual keyboard is shown, i get value equals to 480 - (height of virtual keyboard). Is there any function to determine real display height on any device (with or without keyboard, with enabled or disabled virtual keyboard).

Im also discover RIM classes:

I get these values with 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 showed virtual keyboard:

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 any way to determine real screen height?

like image 500
Vlad Tsepelev Avatar asked Mar 02 '10 11:03

Vlad Tsepelev


1 Answers

I would like to know workaround too

In the meantime you can store size of display for different devices and retrieve them depending on DeviceInfo.getDeviceName()

Or you can save Display.getHeight() value on app start

like image 124
Maksym Gontar Avatar answered Dec 15 '22 00:12

Maksym Gontar