I do not work much with Androids, but have to cater for Androids on and off. As far as I recollect with the Kindle Fire, though the resolution was 1024x600, part of the screen is covered with a system buttonBar that houses the buttons.
So my question is for those that work with various Android devices, on iOS getting the DeviceHeight and Width and subtracting the toolbarHeight would give the usable size of the screen. With Androids, does Gideros return the usable size of the actual size advertised?
I have some resizing code and want to make sure that if it checks for 1024x600 and the device returns 1024x560 then the code will fail. So any feedback on this??
Comments
With devices I've tried, the onscreen toolbar is not calculated in, thus you would have the 1024x560
but with the latest Android version, there is an immersion mode, which can be enabled and you will have full 1024x600
For as long as I know, then immersion can be enabled programmatically:
https://developer.android.com/training/system-ui/immersive.html
But maybe there will also be end user way to enable/disable it.
Author of Learn Lua for iOS Game Development from Apress ( http://www.apress.com/9781430246626 )
Cool Vizify Profile at https://www.vizify.com/oz-apps
working with the screen resolutions is easier than working with models and types, etc.
Author of Learn Lua for iOS Game Development from Apress ( http://www.apress.com/9781430246626 )
Cool Vizify Profile at https://www.vizify.com/oz-apps
Reminds me of my love for Androids and Java...
Where all of the android hardware I spend my money on is unusable, where as all of the Apple hardware (iPod, iPad, iPhone) some of them are not usable for development now, but still function well as music players and phones or gaming pads. Where as the Androids are just battery guzzlers that switch off before you can do anything.
But just because a large majority of people afford and buy Androids, there is that voice of reason that suggests include Androids as a user base. While there are more users that purchase (with real money) on the Apple Store than on Google Play. So, why Androids???
My rant for the week....
Author of Learn Lua for iOS Game Development from Apress ( http://www.apress.com/9781430246626 )
Cool Vizify Profile at https://www.vizify.com/oz-apps
Fragmenter - animated loop machine and IKONOMIKON - the memory game
Author of Learn Lua for iOS Game Development from Apress ( http://www.apress.com/9781430246626 )
Cool Vizify Profile at https://www.vizify.com/oz-apps
In the interim, I guess this would be a good idea, while I am also thinking of other alternatives.
It would still help to have functions that return the screen size in inches, dpi, etc
Author of Learn Lua for iOS Game Development from Apress ( http://www.apress.com/9781430246626 )
Cool Vizify Profile at https://www.vizify.com/oz-apps
So let's start with what is needed.
For now you can retrieve dimensions in logical units using
application:getContentWidth/Height
Then you can get devices usable dimensions in pixels using
application:getDeviceWidth/Height
You can also get screen density (dpi) using:
application:getScreenDensity
So now here I might be a little lost in the units, but it means you can get inches by multiplying dpi with pixel quantity, right?
So the only thing that is needed is to get real dimensions with something as
application:getRealDeviceWidth/Height
Which on ios and desktop can return same deviceWidth/Height dimensions?
Does it make sense?