I have two android device with same resolution
Device1 -> resolution 480x800 diagonal screen size -> 4.7 inches
Device2 -> resolution 480x800 diagonal screen size -> 4.0 inches
How to find device diagonal screen size?
Detect 7 inch and 10 inch tablet programmatically
I have used the above link but it gives both device diagonal screen size -> 5.8
Pythagoras theorem to find the diagonal size of Android phone/tablet screen, same principal can be applied to iPhone or Blackberry screen.
Try as below the other way:
Try this:
Don't forget to multiply the screen size by the scaledDensity if you are doing what I did and change the size of stuff based on the screen size. e.g.:
Note the second last line! Here's more info the scaledDensity stuff: What does DisplayMetrics.scaledDensity actually return in Android?
This won't work?
try this code to get screen size in inch