This week's book giveaways are in the Refactoring and Agile forums.We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!

# size of images in different screens

sam liya
Ranch Hand
Posts: 1240
I need to handle different screen sizes in android.Anyway i found the below in android developer.

can anyone tell me above details for px values,because when we try to download pictures we found pictures in px values.not in dp .

Steve Luke
Bartender
Posts: 4181
21
• 1
The measurements you gave are for screen density, in 'dots per inch', which is the same as 'pixels per inch' on a screen. There are a wide variety of screen sizes and screen density combinations, so categorizing screens by number of pixels ends up being very difficult. The majority of the reason you care about the number of pixels is based on the density, the number of pixels per inch. You want your assets / images to be clean and take up relatively the same physical size on all devices to make sure they are usable and nice looking.

So to do that, you decide how large, in inches, you want the asset to be. Say you want a particular image to be 1/4" x 1/4" in size. Then you decide how big that image has to be, in pixels, on an mdpi density: at 160dpi, for 1/4", that would be 40 pixels x 40 pixels. Then you convert to the other sizes by multiplying by the correct conversion: lpdi = 3/4 * mdpi (30x30 pixels), hdpi: 1.5 * mdpi (60x60 pixels), and xhdpi = 2 * mdpi (80x80 pixels).