tags:

views:

19

answers:

0

Could anyone please confirm the formula for calculating the screen density?

As I have read, the following is the formula:

Density = SQRT (wp^2 + hp^2)/screen size

wp -> width of the screen (in px) hp -> height of the screen (in px) screen size -> Physical screen size (diagonal inches)

screen size (320x480) = SQRT(102400 + 230400) /160 = 3.6 inches

screen size (480x800) = SQRT(640000 + 230400) /160 = 5.8 inches

screen size (480x854) = SQRT(729316 + 230400) /160 = 6.12 inches

So, the layouts (UI screens) are driven by screen sizes (small: <3", normal <4", large >5") and drawable resources (images) are driven by screen densities.

And, the size of the image (in pixels) does not change if the density of the screens (320x480, 480x800, or 480x854) are the same.

Could anyone please confirm?

Thanks, Ram