Android Question Get exact screen size

MitchBu

Active Member
Licensed User

yfleury

Active Member
Licensed User
I am not sure, but if the home button is software (visible only with device in turn on) then this is why it show smaller.

The best is to provide us a screen shot
 

yfleury

Active Member
Licensed User
have you this a top of Main

fullscreen.JPG

With that, my app have no title, and no top or buttom bar
 

William Lancee

Active Member
Licensed User
B4X:
    Dim r As Reflector
    r.Target = r.GetContext
    r.Target = r.RunMethod("getResources")
    r.Target = r.RunMethod("getDisplayMetrics")
    Log(r.GetField("xdpi"))
    Log(r.GetField("ydpi"))
    
    Log(GetDeviceLayoutValues.Width/r.GetField("xdpi"))
    Log(GetDeviceLayoutValues.Height/r.GetField("ydpi"))
 

MitchBu

Active Member
Licensed User
Great.

I just tried, and it is extremely precise.

Since my app is printing on a letter size sheet of paper, I will be able to present the user with Wysiwyg on the screen when a tablet offers 8 1/2 inches wide.

Thank you William :)
 
Last edited:
Top