The desire have 480 x 800 pixels, 3.7 inches and the HD have 480 x 800 pixels, 4.3 inches screen specification.
I run the code that is accepted as answer from this thread How to get screen size of device? but it is wrong. For example for screen size of 3.7 inches returns 2.4 which is very wrong.
Does anybody know how to get the real screen size? I do not need the resolution I need the screen size of the screen in inches.
NOTE: this code is wrong (at lest doesn't work for me)
DisplayMetrics dm = new DisplayMetrics();
getWindowManager().getDefaultDisplay().getMetrics(dm);
int width = dm.widthPixels; //give me 320
int height = dm.heightPixels; //give me 533
I have HTC Desire and my resolution is 480 x 800 pixels,
Can someone please tell me how to get the real screen size in inches, and get the real resolution of the device?