Orientation from Android Accelerometer

后端 未结 4 1028
旧巷少年郎
旧巷少年郎 2020-12-10 12:52

I testing the accelerometer output on 2 different devices(Elocity A7 and Archos 7 Home tablet) but the sensor seems to be giving different results. I have it programmed to s

4条回答
  •  一生所求
    2020-12-10 13:43

    As far as I know this is because of default orientation of device. F.e. new android tablets with Honeycomb have portrait orientation when held like in landscape on phones.

    http://developer.android.com/reference/android/hardware/SensorEvent.html

    In android documentation there is information that:

    The coordinate-system is defined relative to the screen of the phone in its default orientation. The axes are not swapped when the device's screen orientation changes.

    The X axis is horizontal and points to the right, the Y axis is vertical and points up and the Z axis points towards the outside of the front face of the screen. In this system, coordinates behind the screen have negative Z values.

    Maybe one of this devices has also landscape as a portrait (default) orientation?

    Hope it helps you somehow.

提交回复
热议问题