Android phone orientation overview including compass

前端 未结 4 1405
佛祖请我去吃肉
佛祖请我去吃肉 2020-11-28 01:08

I\'ve been trying to get my head around the Android orientation sensors for a while. I thought I understood it. Then I realised I didn\'t. Now I think (hope) I have a better

4条回答
  •  不知归路
    2020-11-28 01:44

    I was having this issue so I mapped out what happens in different directions. If the device is mounted in landscape fashion, eg in a car mount the 'degrees' from the compass seem to run from 0-275 (going clockwise) above 269 ( between west and north) it counts backwards from -90 to 0, then forwards from 0 to 269. 270 becomes -90

    Still In landscape but with the device lying on its back my sensor gives 0-360. and in portrait mode it runs 0-360 both lying on its back and standing up in portrait.

    Hope that helps someone

提交回复
热议问题