Getting Device Screen Height and width in inches

I’m trying to get the get the device height and width in inches and using this method.
(Screen.currentresolution.width)/ Screen.dpi and Screen.currentresolution.height but this doesn’t seem to work for me , Can you tell what’s wrong and suggest the right thing.
thank you .

Hi @sourav13

	float ScreenWidthInch = Screen.width / Screen.dpi;
	float ScreenHeightInch = Screen.height / Screen.dpi;

This will give the physical width and height of the device screen in inches.

You can view the result in the unity editor itself, if you debug the values.

Assuming you’re talking about Android devices, pre Unity 5.1 Screen.dpi is an average of xdpi and ydpi. Now it’s the densityDPI. If you want more accurate method, refer to the following http://forum.unity3d.com/threads/screen-dpi-on-android.414014/