我正在听我的手机 GPS 并将纬度和经度发布到我的网络服务中,每次onLocationChanged
都会被调用。我的问题是,在我大约 2% 的帖子中,它显示的结果非常不准确(相距几英里)。我应该在发布之前检查我的location
对象的准确性吗?或者你有什么其他建议吗?谢谢!
public void onLocationChanged(Location location) {
locationManager.removeUpdates(networkLocationListener);
textView.setText(textView.getText().toString() + "New GPS location: "
+ String.format("%9.6f", location.getLatitude()) + ", "
+ String.format("%9.6f", location.getLongitude()) + "\n");
//float accuracy = location.getAccuracy(); check this value?
postLocationToWebservice(location);
}