3

the more I read the Supporting Multiple Screens guide, the more I get confused. if the layout folder's qualifier is based on size (small, normal, large and xlarge) and the drawable folder's qualifier is based on density (ldpi, mdpi,hdpi and xhdpi), then how can I specify the size of the drawables/images?? should all the images inside the drawable folders have the same size (based on the normal screen size) but different densities (i.e. pic.png inside drawable.ldpi has the same width and height of pic.png inside drawable.mdpi but has different density)?? the problem is that each screen size may include the three densities (i.e. a large screen may be ldpi,mdpi or hdpi). .how can I be designing the images on size basis and on density basis on the same time?? thank you.

a fair player
  • 11,530
  • 9
  • 46
  • 48

2 Answers2

2
36x36 for low-density
48x48 for medium-density
72x72 for high-density
96x96 for extra high-density

http://developer.android.com/guide/practices/ui_guidelines/icon_design.html

hope this helps.

Sergey Benner
  • 4,421
  • 2
  • 22
  • 29
  • 3
    Good piont sergey, These, sizes are for your icon image, that gets shown on the homescreen and in the app drawer. You can make your applications resources that you use to build your UI whatever size you like. – FoamyGuy Jan 24 '12 at 14:31
  • http://developer.android.com/guide/practices/screens_support.html Table 3 in the "How to Test Your Application on Multiple Screens" shows the density to resolution ratio as you have written it mate. – Sergey Benner Jan 24 '12 at 14:36
1

In general you'll want the smallest pictures in ldpi, middle ones in mdpi, and larger in hdpi etc...

Even though it is technically possible for a device to have a "large" screen and an "ldpi" density manufactures have tended to stick to making devices with big screens be higher density as well.

EDIT:

The images only need to be designed with density in mind. Because if you take the same 100x100 pixel image and show it at 3 different densities it will appear largest (to human eyes) on the smallest density. So to account for that you make 3 images, lets say one 80x80, one 100x100, and one 120x120. Now if you show those 3 images across 3 densities the size that object appears to be to your eyes will be much closer than before.

the large, medium, small etc... qualifiers that you can add to the layout folders are not so much about any image resources themselves, but rather structuring the View components on the given page so as to make best use of the space available.

For instance, if your application has a list of items to choose from in it. On a tablet (large or xlarge) screen it may look nicer and be more effecient to have two or more columns of items displayed in your list on the screen. Whereas on a handset there may not be enough width (in portrait mode) to fit more than 1 column in. So to handle this situation you'd put a layout xml file inside the layout-normal folder that has a single column ListView. Then put another layout xml file in the layout-large folder that uses a GridView so that it can have an additional column

This image will show you roughly which folder the system will pull your images and/ or layout xml files from given the screen size and density.:

size and density breakdown

All of your image resources go in the drawable folders which are qualified with the densities. (ldpi, mdpi, hdpi etc)

The layout folders are what get qualified with the screen size (small, normal, large etc) The layout folders will contain xml layout files only, no images.

FoamyGuy
  • 46,603
  • 18
  • 125
  • 156
  • I know that. but what about the devices that are already out there?!!, I still don't know what dimensions should I give my images or on what basis/standards?? thank you. – a fair player Jan 24 '12 at 14:50
  • 1
    I don't think there are any devices out there that are large and ldpi. As far as I know the first Galaxy Tab 7" was the only one that got a little wonky, and it was large screen with mdpi IIRC – FoamyGuy Jan 24 '12 at 14:53
  • ok, it's not a large-ldpi problem, it's a conceptual problem...how can i be designing the images on size basis and on density basis on the same time?? (I'll vote you up for keeping helping me, thank you) – a fair player Jan 24 '12 at 14:57
  • I can think of another sample as Dell Streak 7/5 both coming with 800x480 and 187dpi/ppi despite of the good screen size. I know it cause I have this ugly(ds5) myself :) – Sergey Benner Jan 24 '12 at 18:49
  • @Tim well, thank you for your help and for the explanation. let me ask you one more question... after all is it totally relative when it comes to the choice of the dimensions and ratio between the dimensions when creating images for the 3 densities?? OR should I use (large screens are at least 640dp x 480dp normal screens are at least 470dp x 320dp small screens are at least 426dp x 320dp) to choose the width and height of each image and in the same time fill the images with the required densities such as ldpi screens (~120dpi). mdpi screens (~160dpi). hdpi screens (~240dpi).?? – a fair player Jan 25 '12 at 13:24