Device width and height

Monkey Targets Forums/Android/Device width and height

Simon(Posted 2011) [#1]
Hi, I was just wondering if DeviceWidth() and DeviceHeight() are relative to the screen orientation or independent from it.

So does DeviceHeight() always refer to the longer part of the phone, or does this change when you switch between portrait and landscape?


Dima(Posted 2011) [#2]
An app with 'user' orientation will change those functions returns, depending on the tilt. You can add a simple check in code to detect if DeviceWidth() or DeviceHeight() change from previous frame and act accordingly. 'portrait' and 'landscape' will keep the dimensions.