Hi there!
I’m making an app that wants to know if it is running on a screen over a certain physical size. On apple, I’ve determined the screen size of every apple device, and put it in a lookup table. Android is supposed to give me the correct screen size using:
local width = system.getInfo("androidDisplayWidthInInches") local height = system.getInfo("androidDisplayHeightInInches")
However, on the 65" android Smart TV (Jector FM-A65) I am using to test, these calls are returning a w x h of 8" x 4.5", which is clearly incorrect. According to
local approxDPI = system.getInfo("androidDisplayApproximateDpi") local densityName = system.getInfo("androidDisplayDensityName")
the screen is reporting as 240 dpi, which is the “hdpi” density bucket. The content unit dimensions reported for the screen are 480 x 270. I think this information probably has little to do with the physical size of the screen, but it is the correct aspect ratio, and the tv is supposed to be 4k (hdpi). I suspect that the system is just incorrectly reporting its screen size – but is there any way to measure the size of a screen? Is there any setting I may be missing that is stopping the app from getting the correct screen size? My build.settings file for android has the following:
supportsScreens = { smallScreens = true, normalScreens = true, largeScreens = true, xlargeScreens = true, },
Help me, Obi Wan, you’re my only hope!