Is there any way to get physical height and width of screen grammatically.
I tried this one
DisplayMetrics dm = new DisplayMetrics();
getWindowManager().getDefaultDisplay().getMetrics(dm);
double x = Math.pow(dm.widthPixels/dm.xdpi, 2);
double y = Math.pow(dm.heightPixels/dm.ydpi, 2);
double screenInches = Math.sqrt(x+y);
What else I found is, in Portrait and Landscape it returning different values.
and it's giving height probably, on my nexus it's 4.41 something. Any one have idea/suggestion here?