如何获得当前 GPS 位置的准确 latitude/longitude?

How can I get accurate latitude/longitude of current GPS location?

我正在使用 GPS Tracker class,我想获得准确的当前位置。

但每次,我得到的位置都不同(20 米精度)。

GPS 追踪器 Class:http://eclatsol.net/GPSTracker.java

代码:

gpsTracker = new GPSTracker(getActivity());
if (gpsTracker.canGetLocation()) {
   mLatitude = gpsTracker.getLatitude();
   mLongitude = gpsTracker.getLongitude();
}

当时我在做Indoors测试。

你可以参考Fused Location API and it's high accuracy option. The documentation says,

PRIORITY_HIGH_ACCURACY - Use this setting to request the most precise location possible. With this setting, the location services are more likely to use GPS to determine the location.

现在我还在旧设备 (Samsung Galaxy S3) 上进行了测试(室内,靠近阳台)。我收到的位置更新精度在 5 米到 15 米之间。测试代码来自,googlesamples/android-play-location

GPSTracker类 私人静态最终长 MIN_DISTANCE_CHANGE_FOR_UPDATES = 10; 私人静态最终长 MIN_TIME_BW_UPDATES = 1000 * 5;