Mehrzad238
Member
I know that there is a lot of question about screen size on this forum but I need to know which one is the right one to use
my phone is Xiaomi Redmi 8 with a 6.2-inch screen size but the result says another thing!
my phone is Xiaomi Redmi 8 with a 6.2-inch screen size but the result says another thing!
B4X:
Dim lv As LayoutValues
lv = GetDeviceLayoutValues
Log( Sqrt(Power(lv.Height / lv.Scale / 160, 2) + Power(lv.Width / lv.Scale / 160, 2)))
Log(Sqrt(Power(800 /160, 2) + Power(480 / 160, 2)))
Dim r As Reflector
r.Target = r.GetContext
r.Target = r.RunMethod("getResources")
r.Target = r.RunMethod("getDisplayMetrics")
Dim xdpi As Double = r.GetField("xdpi")
Dim ydpi As Double = r.GetField("ydpi")
Dim lv As LayoutValues
lv = GetDeviceLayoutValues
Log( Sqrt(Power(lv.Width / xdpi, 2) + Power(lv.Height / ydpi, 2)))
Last edited: