0

I wanted to differentiate between 43 inch and 50 inch smart tvs and using display metrics i was able to get close enough result on my smartphone but on a 50 inch 4k tv it returns 28 inches with 1920×1080 resolution, I installed some device info apps on the TV and they also show the size as 28 inch with 1080 res.

This answer suggested using DisplayCompat.ModeCompat, which has methods getPhysicalWidth and getPhysicalHeight that returns the correct resolution, but no other properties like display metrics that can help in determining the Inches.

I want to know if there is methods inside DisplayCompat or other ways may to get the exact inch like combining the resolution, ppi or aspect ratio or if there is a library.

1 Answers1

0

You can get the resolution of the screen in pixels of evey Android device.

Also you can get pixels per inch (or dots per inch) for every Android device.

So yes you can calculate the demension of the screen.

The device itself will not be smaller ;-)

blackapps
  • 8,011
  • 2
  • 11
  • 25
  • That may work for phones and tablets. It may not work for televisions. In particular, with TV set-top boxes, the box may not know the physical size of the television. The density reported by the box will be some value chosen by the manufacturer. That is why `tvdpi` was introduced -- it was the density reported by the original Google TV boxes. – CommonsWare Aug 28 '22 at 10:48