Sensor驱动:Location API 取不到GPS经纬度等数据或不识别传感器
?
---------------------------------------华丽的分割线-----------------------------------------
?
?
?
sensor驱动: 客户端要使用location api取gps的经纬度值,但总取不到。
在调试了几天后(--!)发现有个容易被忽略的常量:SENSOR_DATA_TYPE_ERROR_RADIUS_METERS
?
?关于其说明的地方已经清楚地指出:
?1.?Accuracy of latitude and longitude values, in meters. A value of zero means that the accuracy level is not known. The Location API gives priority to sensors that provide a non-zero value for this field.
?2. Do not report a value for SENSOR_DATA_TYPE_ERROR_RADIUS_METERS that is zero or less.
?3. Report a valid value for SENSOR_DATA_TYPE_ERROR_RADIUS_METERS before raising events or changing the value for SENSOR_PROPERTY_STATE to SENSOR_STATE_READY.
也就是说不能为零,否则它是不会向api提供数据的。
?
?