I built a simple application for Nexus 7. I used the following code to get the screen size in DP units.
this.getResources().getConfiguration().screenWidthDp;
this.getResources().getConfiguration().screenHeightDp;
where "this" is MainActivity context object.
I get these values: 600 dp for width and 888 dp for height.
Pixel density is tvdpi
which is 213, and the ratio of dp to pixels is 1.33
I used this formula
pixels = dips * (density / 160)
which gives me for height
pixels = 888 * (213 / 160) = 1182.15.
I know that pixel size of the Nexus 7 screen is 800 x 1280. Where are the missing 100 pixels of height in this calculation? Or did I do something wrong?