Android Question GetDeviceLayoutValues.ApproximateScreenSize VS ActivitySize

Discussion in 'Android Questions' started by MarcoRome, Feb 18, 2015.

  1. MarcoRome

    MarcoRome Expert Licensed User

    Hi all, i have this problem. Why beetwen GetDeviceLayoutValues.ApproximateScreenSize and ActivitySize i have different Result ??

    This is code in Activity_create
    Code:
    Sub Activity_Create(FirstTime As Boolean)
        
    'Do not forget to load the layout file created with the visual designer. For example:
        Activity.LoadLayout("1")
    ' < 4.5
    If GetDeviceLayoutValues.ApproximateScreenSize < 4.5 Then
        Label2.Text = 
    "ApproximateScreenSize: " & GetDeviceLayoutValues.ApproximateScreenSize
    ' > 4.5 e < 8
    Else If GetDeviceLayoutValues.ApproximateScreenSize > 4.5 AND GetDeviceLayoutValues.ApproximateScreenSize < 8 Then
        Label2.Text = 
    "ApproximateScreenSize: " & GetDeviceLayoutValues.ApproximateScreenSize
    'Tablet > 8
    Else If GetDeviceLayoutValues.ApproximateScreenSize > 8 Then
        Label2.Text = 
    "ApproximateScreenSize: " &  GetDeviceLayoutValues.ApproximateScreenSize
    End If
     
    End Sub
    This is code in Design Script:

    Code:
    'All variants script
    AutoScaleAll
     
    Label1.Text = 
    "ActivitySize: " & ActivitySize
    The result is:
    GetDeviceLayoutValues.ApproximateScreenSize = 3.60
    ActivitySize = 3.23

    screensize.png

    Any idea ??

    Thank's
    Marco
     
    vecino likes this.
  2. Erel

    Erel Administrator Staff Member Licensed User

    ApproximateScreenSize is the size of the whole screen. ActivitySize is the size of the activity (without the top and bottom bars).
     
    vecino and MarcoRome like this.
  3. wonder

    wonder Expert Licensed User

    Erel, please clarify. What does the number mean?
    a) Is it the horizontal Size? Vertical Size? Diagonal? Area?
    b) Inches or Centimeters?
     
  4. DonManfred

    DonManfred Expert Licensed User

    a) Diagonal
    b) Incches
     
    wonder and Erel like this.
  5. wonder

    wonder Expert Licensed User

    Thank you so much! :)

    Is there a way to know the physical horizontal and vertical sizes, or at least, the screen's aspect ratio?
     
  6. Erel

    Erel Administrator Staff Member Licensed User

    JordiCP, DonManfred and wonder like this.
  7. wonder

    wonder Expert Licensed User

    Thanks a lot, Erel!!
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice