Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Android / How to get native device screen resolution

Author
Message
Davee
8
Years of Service
User Offline
Joined: 6th Sep 2011
Location: North West of England
Posted: 26th Oct 2013 13:41
Is there a command to get/read the native device screen resolution. I has just been looking through the docs but have not found one.
Ancient Lady
Valued Member
15
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 26th Oct 2013 18:52
Sometimes GetDeviceWidth() and GetDeviceHeight() will work. Not in Windows or Mac, but usually on mobile devices.

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master
Davee
8
Years of Service
User Offline
Joined: 6th Sep 2011
Location: North West of England
Posted: 28th Oct 2013 01:44
I was sure I had tried GetDeviceWidth() and GetDeviceHeight() before, wihout setting width/height in the setup file, and it didn't work - still returned default 320x480 on my S3.
Just tried it again with a little demo app and it displays the native width/height of 720x1280.

hmmmmm.

Anyway you are right, thanks. +1 to Ancient Lady
Ancient Lady
Valued Member
15
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 28th Oct 2013 03:05
The setup.agc file only works for Windows.

If you are testing through the Player then it may be interfering with the readings. It probably has a default setting to start with.

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master

Login to post a reply

Server time is: 2019-10-14 02:17:01
Your offset time is: 2019-10-14 02:17:01