question

christinalam37 avatar image
christinalam37 asked

How to get physical screen size?

I want to make an app that show the actual size of objects like clothes. So I'm wonder if there's anyway I can get the actual tv size in inches? Thanks a lot for helping!!
fire tv
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

Nick Gardner avatar image
Nick Gardner answered
Hi, There is no particularly reliable way to do this, the available methods all rely on the TV reporting information properly, as well as several other factors. The most reliable way to get a measurement would be to ask the user to input the diagonal screen size of their TV. However, you can use the Android DisplayMetrics class to get the DPI and then use the resolution to do a screen size calculation.
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.