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. No output on the eclipse console

Hi,
When i print any output to the console using System.out.println() or when i
use the Log class for debug, it is not printing on the eclipse console.
I could see the Log class debug message on DDMS monitor console. But not on
the eclipse console. Any idea why?

-- 
Thanks and Regards
Chinnadurai M

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

2. info needed on configuring buildbot for android

Hi all,

I've setup a buildbot for android. Android doesn't use "Git" commands
directly, but instead uses a command called "repo" to checkout out the
source. So i cannot use the git source step in the buildbot.

My source checkout step is:
f1.addStep(shell.ShellCommand, description= "Initialize the repo, sync
and checkout the tag", command= "repo_init.sh", haltOnFailure=True)

The repo_init.sh is the script which runs the commands:
repo init -u git://android.git.kernel.org/platform/manifest.git
repo sync
repo forall -c git checkout TAGXYZ

This is working quite fine, but there is an issue with the source
stamp. It always shows the branch "HEAD" instead of the tag being
checked out "TAGXYZ". Browsing through the buildbot source (buildbot/
steps/source.py), found that the revision is being set in the source
checkout step of each version control system. But since the "repo"
command is not supported in the buildbot, how do i go ahead to set the
revision?. Also the waterfall results page shows as

Recent Builds:
(Jul 07 00:30) rev=[??] success #14: build successful
(Jul 06 00:30) rev=[??] failure #13: failed shell_4
(Jul 05 00:30) rev=[??] failure #12: failed shell_4
(Jul 04 00:30) rev=[??] failure #11: failed shell_4
(Jul 03 00:30) rev=[??] failure #10: failed shell_4

You can make out that the revision is being shown as question marks.
I'm using a nightly scheduler.


Any help???


Thanks,
Anantvijay

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

3. Android code coverage tools

4. Views with round corners and transparent background color

5. How was the conference - man i wanted to go

6. Who is making money in the Android Market?

7. ListView: Default highlight the item