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.

AppGameKit Classic Chat / Android Screen Size

Author
Message
badkneecap
14
Years of Service
User Offline
Joined: 21st Jun 2010
Location:
Posted: 8th Dec 2011 04:17
What's the best virtual resolution to use when designing a game for the Android? I have a Droid Bionic. The last game I created I used 480x320 and I had some space on the sized. I didn't want to guess. Does anyone know the exact size? Are they different for different Android phones?
DVader
20
Years of Service
User Offline
Joined: 28th Jan 2004
Location:
Posted: 8th Dec 2011 06:21
I'm no expert, but I imagine there are various resolutions on android devices. Screen size will be one factor for this, and newer versions of the OS will support various resolutions as they emerge. I should imagine you could search the specs of your phone to find out it's exact res.

Mobiius
Valued Member
21
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 8th Dec 2011 15:49
I'd use the 100x100 virtual resolution, and the setscreenaspect command to ensure it fits correctly. Thats what I do in my 3 released games and it works fine. I also discovered that the iPhone resolution is a great midpoint between the various mobile resolutions and would suggest basing games on that. (Even though I hate iphones. )

So, when developing, set the setup.agc file to run a resolution of 480x320, with a virtual resolution of 100x100 and the setdeviceaspect command to fill the screen. The setup.agc file isn't used on the devices so your app will automatically run fullscreen, and scaled correctly.

My signature is NOT a moderator plaything! Stop changing it!
Marl
13
Years of Service
User Offline
Joined: 19th Nov 2011
Location: Bradford, UK
Posted: 8th Dec 2011 21:35 Edited at: 8th Dec 2011 21:36
I prefer to take the other approach and work to the resolution of the device.

I set the virtual resolution based on the return values from getDeviceWidth() and getDeviceHeight() and get the app to work to this.

There is no right and wrong answer, it's what works best for you and your development style.

BTW, android assumes a minimum resolution of 320x480 ( based on the first android phone, the T-Mobile G1 ), there is no upper limit.

http://developer.android.com/guide/practices/screens_support.html
Mobiius
Valued Member
21
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 8th Dec 2011 21:45
Quote: "I prefer to take the other approach and work to the resolution of the device."

That would mean recoding all the graphics positions/sizes when the resolution/aspect changes. My method does not require this.

But you're right, there is no right or wrong answer, that's why I can never fail at being a programmer! lol

My signature is NOT a moderator plaything! Stop changing it!
Marl
13
Years of Service
User Offline
Joined: 19th Nov 2011
Location: Bradford, UK
Posted: 8th Dec 2011 22:08
Quote: "That would mean recoding all the graphics positions/sizes when the resolution/aspect changes. My method does not require this."

Perhaps on a PC, but I'm primarily coding for android so the device resolution is fixed. Orientation changes involve some reworking of the screen whatever system you use.
Mobiius
Valued Member
21
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 9th Dec 2011 14:40
Quote: "I'm primarily coding for android so the device resolution is fixed"

Android devices have many resolutions, just like pc. You could still run into issues.

My signature is NOT a moderator plaything! Stop changing it!
Digital Awakening
AGK Developer
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Sweden
Posted: 12th Dec 2011 15:03
I currently base my games on an 800x480 resolution, it's quite popular among large screen Android phones. The current iPhone resolution is 960x640 IIRC. The Android resolution is more narrow the the iPhone.

I like to know where all my pixels are and code around it. I code my HUD to be relative to the corners or center points of the screen. I intend to use backgrounds that can be cropped and/or scaled to fit.

When you scale sprites in AppGameKit they tend to get white around the edges or get other similar problems. It might be a good idea to release HD and SD versions of your games. The HD versions have high res images and looks good on larger screens while taking up more storage. SD versions would be better suited to smaller phones with smaller screens and storage.

Login to post a reply

Server time is: 2024-11-22 19:30:33
Your offset time is: 2024-11-22 19:30:33