Win a copy of Classic Computer Science Problems in Swift this week in the iOS forum!
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Sheriffs:
Saloon Keepers:
Bartenders:

# size of images in different screens

Ranch Hand
Posts: 1287
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 .

Bartender
Posts: 4181
22
• 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).

 Did you see how Paul cut 87% off of his electric heat bill with 82 watts of micro heaters?