Search code examples
androidpixel

Android: How pixel density is calculate?


Today I saw the Nexus 7 specifications.
It has resolution of 1200 x 1920 pixels and physical screen size of 4.49 x 7.87 inches.

The specs says it has 323 density. How did they calculated this number?

I been trying to do this:

1200 / 4.49 = 267.26

or this:

1920 / 7.87 = 243.96

But it doesn't get me anywhere. So where they getting this density value from?


Solution

  • This is what I use when calculating "on paper":

    http://labs.rampinteractive.co.uk/android_dp_px_calculator/

    To calculate ppi:

    ppi=(squareRoot(h^2+w^2))/inches

    ppi=(squareRoot(1920*1920+1200*1200))/7

    ppi=(squareRoot(3686400+1440000))/7

    ppi=(squareRoot(5126400))/7

    ppi=2264.155~/7

    ppi=323.45~