Android Question Screen Size

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!

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:

Mehrzad238

Member
I have problems with the design and one of them is screen size, for example, I have a 6-inch screen device works just fine when I am going on 5.5-inch views going to each other and I thought that this could help me with that, can anyone guide me with this?
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…