Android Question Rotate phone

Discussion in 'Android Questions' started by dibesw, May 25, 2015.

  1. dibesw

    dibesw Active Member Licensed User

    Can I take rotate smartphone event for this case?

    [​IMG]
     
  2. ilan

    ilan Expert Licensed User

    hi, try PhoneAccelerometer for that (use the Z axis to check if phonescreen is on table...)

    Code:
    Sub Process_Globals
        
    Dim Accelerometer As PhoneAccelerometer
    End Sub

    Sub Globals
    End Sub

    Sub Activity_Create(FirstTime As Boolean)

    End Sub

    Sub Activity_Resume
        Accelerometer.StartListening(
    "Accelerometer")
    End Sub

    Sub Activity_Pause (UserClosed As Boolean)
        Accelerometer.StopListening
    End Sub

    Sub Accelerometer_AccelerometerChanged (X As Float, Y As Float, Z As Float)
        
    Log("Z: " & Z)
    End Sub
     
  3. ilan

    ilan Expert Licensed User

    Z-10 is face down...
     
    Last edited: May 25, 2015
  4. dibesw

    dibesw Active Member Licensed User

    YES. I arrived late. Thank you
     
  5. Cableguy

    Cableguy Expert Licensed User

    you should/could also use the light sensor to check if in fact the phone is facing a table
     
  6. ilan

    ilan Expert Licensed User

    will it also work if the table is made of glass? :rolleyes:
     
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