What base resolution you aim for when building for Android? (2D games)


I’m well aware of Android’s fragmentation problem and there is standard resolution for it, but for today’s age of Android devices out there, what resolution you consider to be “average” when making your game?

For iOS it’s usually iPhone 4’s 960x640.


I dont think it is good solution to aim only for one resolution, there are really big segmentation in Android market, and you have to satisfy all of them.

Here is a tip for you, may be there are better solutions, but thats the way im handling various types of resolutions:

Unity can tell you at launch time it “Screen.Width” and “Screen.Height” each time on different devices it will be different and it will be nightmare to hard code sizes of GUI elements and other GO.
What im doing is defining screen area in bloks or parts in percentage

for example you have simple menu with bottom menu bar where you have buttons and header bar where you have logo
alt text

At this point you have no idea what size of the buttons in the bottom bar should be as resolution could be different, and you cant hardcode values for each of them.

what you can do is divide screen on parts, lets say 10 parts:

int oneTenth = Screen.Height / 10;

alt text

That way it doesn’t matter what resolution you are, the proportion of the screen still will be 1 out of 10 on each resolution. So you can set your button height to be equal one tenth of the screen.

The same with width: you know you need to fit 5 buttons at the bottom

so you go:

int btnWidth = Screen.Width / 5; 

keep in mind that you dont want button to be very close to each other so you need to add some space or offset to each button

int offset = 5; //5 pix offset for each button

so each your button should have 2 offsets from left and right like this:

offset|BTN1|offset|offset|BTN2|offset… etc.

so far you would have 10 offsets by 5px and 5 buttons, so the formula will be:

int btnWdth = (Screen.Width - offset * 10) / 5; 

the same stuff related to the height. you got your one tenth of the screen, but you also can apply height offset within this one_tenth like this:

//offset at the top and bottom of the button
    int btnHeight = oneTenth - offset * 2; 

that way your app will be scaled in correct proportion in any kind of resolution or platform