Android Question Get exact screen size

MitchBu

Well-Known Member
Licensed User
Longtime User

yfleury

Active Member
Licensed User
Longtime 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
 
Upvote 0

yfleury

Active Member
Licensed User
Longtime User
have you this a top of Main

fullscreen.JPG

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

William Lancee

Well-Known Member
Licensed User
Longtime 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"))
 
Upvote 0

MitchBu

Well-Known Member
Licensed User
Longtime 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:
Upvote 0
Top