如何获得Android的罗盘读数?读数、如何获得、Android

2023-09-06 02:35:41 作者:初雪未霁

现在的SENSOR_ORIENTATION是德precated,什么是获得罗盘航向的最佳做法是什么?旧的方式是如此简单。

Now that SENSOR_ORIENTATION is deprecated, what's the best practice for obtaining compass heading? The old way was so simple.

推荐答案

SensorManager.getOrientation(浮动[] R,漂浮[]值)是标准的API调用,因为API级别3使用。

SensorManager.getOrientation(float[] R, float[] values) is the standard API call to use since API level 3.

 
精彩推荐
图片推荐