开发者

Using a rotation vector in earlier Android systems

开发者 https://www.devze.com 2023-03-01 19:21 出处:网络
Hey, for an application I am writing I need to use the data which is given in Sensor.TYPE_ROTATION_VECTOR. The bad news are that I program, among others, to my G1 device, which runs Android 1.6, i.e.

Hey, for an application I am writing I need to use the data which is given in Sensor.TYPE_ROTATION_VECTOR. The bad news are that I program, among others, to my G1 device, which runs Android 1.6, i.e. API Level 4, and not 9 as needed. Nevertheless, I am pretty positive that my phone does have a sort of gyroscope, which means it should be possible for me to get the exact orientation of the phone. So, 开发者_Go百科the question is, how do I do it?

Thank you in advance.


I don't think that the G1 has a gyroscope - it just has the basic accelerometers. Here's an interesting post about how to program to use accelerometers when they are available and not crash when they aren't.

[Update] If your phone has a gyroscope, you will require Android 2.3 (and above) on the phone to get access to it.

0

精彩评论

暂无评论...
验证码 换一张
取 消