Other [quiz] What happens to the device screen size?

Discussion in 'Android Questions' started by Erel, Jul 12, 2015.

  1. Erel

    Erel Administrator Staff Member Licensed User

    Code:
    Code:
    Sub Activity_Create(FirstTime As Boolean)
       
    If 100%x > 100%y Then Log("Landscape"Else Log("Portrait")
       
    Dim lv As LayoutValues = GetDeviceLayoutValues
       
    Log(lv & ", size = " & lv.ApproximateScreenSize)
    End Sub
    Output:

    Landscape
    1794 x 1080, scale = 3.0 (480 dpi), size = 4.3625
    ** Activity (main) Resume **

    Portrait
    1080 x 1776, scale = 3.0 (480 dpi), size = 4.33
    ** Activity (main) Resume **

    Why is device screen size larger in landscape mode?

    Tested on Nexus 5 (it will not happen on all devices).
     
  2. eurojam

    eurojam Well-Known Member Licensed User

    I assume that the pixels used by the navbar are excluded. If you change the orientation of the nexus 5 you can observe, that the navbar in landscape is a little bit smaller then in portrait, this should be the difference of 18pixel.

    stefan
     
    NJDude and Erel like this.
  3. LucaMs

    LucaMs Expert Licensed User

    Pixels are not square
     
  4. eurojam

    eurojam Well-Known Member Licensed User

    but then it should happen to all devices in the same manner?
     
  5. LucaMs

    LucaMs Expert Licensed User

    pixels are different from device to device
     
  6. Erel

    Erel Administrator Staff Member Licensed User

    That's the correct answer.

    You can see it in this screenshot:

    [​IMG]
    The left screenshot is from a landscape device (the image is rotated).

    The soft buttons bar is shorter in landscape orientation.
     
    NJDude likes this.
Loading...