What is the recommended resolution/aspect ratio for android graphics

by Sheepz » Sat, 12 Mar 2011 23:38:27 GMT


Sponsored Links
 Hi All, I'm trying to write an application that will work well on all
screen sizes, for that I have my graphic designer produce images that
are in the requested dpis for each directory (Low density (120), ldpi,
Medium density (160), mdpi, High density (240), hdpi, Extra high
density (320), xhdpi) however, they want to know at which resolution
and aspect ratio each image should be, after looking around the
android documenation, namely: 1) http://developer.android.com/guide/ 
topics/resources/providing-resources.html#AlternativeResources
2) http://developer.android.com/guide/practices/screens_support.html I 
came up with the following information: It is not exact that android
supports 3 screen sizes, android is an OS that can run virtually on
any screen size but there are some screen sizes that are more common
than others, these are demonstrated in the table below (taken from
 http://developer.android.com/guide/practices/screens_support.html )

Table 1. Screen sizes and densities of emulator skins included in the
Android SDK. Low density (120), ldpi Medium density (160), mdpi High
density (240), hdpi Extra high density (320), xhdpi Small screen QVGA
(240x320)
Normal screen WQVGA400 (240x400) WQVGA432 (240x432) HVGA (320x480)
WVGA800 (480x800) WVGA854 (480x854)
Large screen WVGA800* (480x800) WVGA854* (480x854)
Extra Large screen

It worth noting here that even though it seems that there is no
correlation between these screen sizes, there is a 3:4:6 scaling ratio
between the three densities, so a 9x9 bitmap in ldpi is 12x12 in mdpi
and 18x18 in hdpi (see
 http://developer.android.com/guide/topics/resources/providing-resources.html #AlternativeResources).

We can see some more information on what the screen sizes mean here:

Screen size small: Screens based on the space available on a low-
density QVGA screen. Considering a portrait HVGA display, this has the
same available width but less heightt is 3:4 vs. HVGA's 2:3 aspect
ratio. Examples are QVGA low density and VGA high density. normal:
Screens based on the traditional medium-density HVGA screen. A screen
is considered to be normal if it is at least this size (independent of
density) and not larger. Examples of such screens a WQVGA low density,
HVGA medium density, WVGA high density. large: Screens based on the
space available on a medium-density VGA screen. Such a screen has
significantly more available space in both width and height than an
HVGA display. Examples are VGA and WVGA medium density screens. xlarge: Screens that are considerably larger than the traditional
medium-density HVGA screen. In most cases, devices with extra large
screens would be too large to carry in a pocket and would most likely
be tablet-style devices. Added in API Level 9.

We can also support specific aspect ratios, as defined here:

Screen aspect long: Long screens, such as WQVGA, WVGA, FWVGA notlong: Not long screens, such as QVGA, HVGA, and VGA

-- All of this however, is not enough to answer the simple question of
what the resolution should be on those images - can they all be cut
from the same high res image or should they be re-done for each dpi
since the aspect ratio is different?
 Thanks!
P.s. To clarify, I'm talking about images that should take up the
entire screen - images such as backgrounds etc, and not just regular
images

-- 



Re: What is the recommended resolution/aspect ratio for android graphics

by Kostya Vasilyev » Sun, 13 Mar 2011 00:01:44 GMT


 12.03.2011 18:38, Sheepz :
-- All of this however, is not enough to answer the simple question of what the resolution should be on those images - can they all be cut from the same high res image or should they be re-done for each dpi since the aspect ratio is different?
There are four pre-defined densities which Android uses to choose which image to load. You've already listed them above. The actual device screen density can be different, but for image loading purposes, it's one of those "quantized" values. Thus you'll never need an image resource for 167dpi or 235dpi, just 120/160/240/320 (none of those yet). Authorizing wise - ??? whatever is more convenient for the designer. I usually have one "master" HDPI image and use vector-based graphics as much as possible, then scale down for lower densities.
Thanks! P.s. To clarify, I'm talking about images that should take up the entire screen - images such as backgrounds etc, and not just regular images
For these, the aspect ratio is probably more important than density, so you can cover the entire screen (or its portion, as needed) and as much as possible, avoid clipping or empty areas on the sides. You might need to place them into drawable-nodpi, and choose the image to load yourself based on the screen's aspect ratio. There are aspect ratio resource qualifiers (-long / -nolong), but I'm not sure if that's really enough for a background image. -- Kostya Vasilyev -- http://kmansoft.wordpress.com --


Sponsored Links


Re: What is the recommended resolution/aspect ratio for android graphics

by Dianne Hackborn » Sun, 13 Mar 2011 03:37:20 GMT


 



If you just want an image to fill the entire content area of your app, dpi
doesn't matter.  You'll need to pick some variety of sizes, and at runtime
scale the best image of those to match the actual size of whatever screen
you are on.

-- 
Dianne Hackborn
Android framework engineer
hack...@android.com

Note: please don't send private questions to me, as I don't have time to
provide private support, and so won't reply to such e-mails.  All such
questions should be posted on public forums, where I and others can see and
answer them.

-- 



Re: What is the recommended resolution/aspect ratio for android graphics

by brian purgert » Sun, 13 Mar 2011 04:55:54 GMT


 if your making a game or not(after you did all this DPI stuff with diffrent
folders) scale the images in game and in the view too. always use DP never
PX. this stuff can get very confusing especially when you are trying to get
it to work on all phones.
I made a game so I know.
1. Create different folders for diffrent DPI's and Screen sizes if you want.
2. as a precaution scale everything(Using your own method or androids,I did
my own) and in the Layouts just use DP.
if you want to be very precise keep in mind getWidth(); and getHeight();
for example

int final MyScale  getWidth()/800;
ImageWidth = 400 * MyScale;

-- 



Other Threads

1. how to make a SESSION dbus connection on android?

Dear all,
        I am porting obexd to android. When I push the obexd-client to
android emulator, it shows "can't launch dbus-launch for dbus
session". But I can't find the dbus-launch command on emulator. Do you
have any idea to solve this problem? thanks a lot.
--~--~---------~--~----~------------~-------~--~----~

2. Android icons

Apart from the standard G1 icons, are there any sites or free packages
for Android icons?

--~--~---------~--~----~------------~-------~--~----~

3. How to unsubscribe from this list?

4. Broken OpenGL texture output after resuming the app

5. Driver issues on windows 7

6. No com.android.camera.CropImage on HTC Magic?

7. No com.android.camera.CropImage on HTC Magic?