flex-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From OB <patcoyn...@yahoo.co.uk>
Subject Finding pixel height of an Android device
Date Mon, 02 Dec 2013 15:20:50 GMT
Hi, I'm using the air 3.8 sdk for Flex mobile to build a mobile app on an
Android device. The problem I'm having is being able to find the dimensions
of the screen in any orientation without having to reorient the device
first. I need to find landscape and portrait screen dimensions of the device
programmatically.

It is easy to find the available screen dimensions of an iOS device using
FlexGlobals.topLevelApplication.width /
FlexGlobals.topLevelApplication.height. When the device is set to use the
full screen for app, and is rotated, width becomes height and height becomes
width. So I can check what the dimensions of the screen will be without
having to reorient the device first. On Android it is more difficult because
the operating system adds a system bar to the bottom of the screen.
Therefore when when the mobile device is rotated height does not become
width. So I cannot check what the screen dimensions will be
programmatically.

Does anyone know a way to find the actual height of an Android device's
screen, including the system bar. Then I can work out what the screen
dimensions will be in different orientations. Thanks for your help. 



--
View this message in context: http://apache-flex-users.2333346.n4.nabble.com/Finding-pixel-height-of-an-Android-device-tp4049.html
Sent from the Apache Flex Users mailing list archive at Nabble.com.

Mime
View raw message