views:

44

answers:

1

I have a PNG file that is 32x32 pixels. I use 8 of these as drawables in a row for my app. These drawables are not in the hdpi, mdpi, or ldpi folders. I’ve found that when starting any of the 3 standard size emulators, the screen view with all 8 drawables looks pretty much the same.

I note that the ldpi emulator I’m using (QVGA) has a resolution of 240x320. 8 x 32 = 256, so since I can see all my drawables (and space in-between) I’m betting something is changing their size.

I’ve read the Supporting Multiple Screens document at the Android developers page, but I still don’t understand what is actually happening. Could you put your own words to explain what is happening to the size of my drawables and how the SDK knows to automatically modify them?

+1  A: 

Of course - the system automatically resizes your images from the drawable directory to correspond to the DPI of the device if you don't define your own. So in fact the 'drawable' directory is pretty much the same as the 'drawable-mdpi' directory, and because you don't have the ldpi and hdpi versions defined the system automatically builds them out of your mdpi resources. See (1.) here: http://developer.android.com/guide/practices/screens_support.html#support - "Pre-scaling of resources (such as image assets)"

Of course your icons will look somehow ok on ldpi devices but ugly on hdpi devices. That's because the mdpi icons are scaled to match higher dimensions, effectively resulting in less information per pixel.

mreichelt
Neat. Thanks. Is it wise to design the icons around the hdpi, and thus have all other densities scale them down?
I personally would create icons for hdpi and mdpi and let the system scale the icons down automatically, but create ldpi versions of the most important ones - e.g. the launcher icon. Or the simple version: Hire a designer and let him do the work for you. ;-)
mreichelt
Ha, you got that right. Playing with images to get something nice has been such a waste of my time, especially since I have no idea what I'm doing.