问题
I am trying to track my location every 2 mins to check the distance from me to my house. However the results I have been getting have been odd. When I would travel about 700 meters away (to another building) and stay there for 2 hours the results would say that I was always within 40 meters of my home. They would change but the distance never got bigger than that.
private void locationSetup(){
int interval = 120000;
// Create the LocationRequest object
mLocationRequest = LocationRequest.create()
.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY)
.setInterval(interval) // 2 mins, in milliseconds
.setFastestInterval(10000); // 10 seconds, in milliseconds
mGoogleApiClient = new GoogleApiClient.Builder(this)
.addConnectionCallbacks(this)
.addOnConnectionFailedListener(this)
.addApi(LocationServices.API)
.build();
mGoogleApiClient.connect();
}
Because it thinks I am close to my house rather than all over the place I am assuming that it is not an accuracy issue but a cache issue, but I have been unable to find anything related to that online.
What could be causing this?
Here is some logs to show it in action. the distance is distance from my home, at the time I was 700 meters from home.
11-29 17:40:06.106 20319-20319/farmcloud.gpstest I/1885: 04:12 - Distance: 772.6915 - Accuracy: 185.759 - Proivder: fused
11-29 17:40:06.106 20319-20319/farmcloud.gpstest I/1886: 04:13 - Distance: 772.6915 - Accuracy: 529.961 - Proivder: fused
11-29 17:40:06.106 20319-20319/farmcloud.gpstest I/1887: 04:14 - Distance: 707.7302 - Accuracy: 107.0 - Proivder: gps
11-29 17:40:06.106 20319-20319/farmcloud.gpstest I/1888: 04:14 - Distance: 707.7302 - Accuracy: 107.0 - Proivder: fused
11-29 17:40:06.106 20319-20319/farmcloud.gpstest I/1889: 04:15 - Distance: 696.931 - Accuracy: 60.0 - Proivder: fused
11-29 17:40:06.106 20319-20319/farmcloud.gpstest I/1890: 04:16 - Distance: 670.4543 - Accuracy: 131.0 - Proivder: fused
11-29 17:40:06.106 20319-20319/farmcloud.gpstest I/1891: 04:18 - Distance: 704.91797 - Accuracy: 92.0 - Proivder: gps
11-29 17:40:06.106 20319-20319/farmcloud.gpstest I/1892: 04:18 - Distance: 704.9204 - Accuracy: 92.0 - Proivder: fused
11-29 17:40:06.106 20319-20319/farmcloud.gpstest I/1893: 04:18 - Distance: 765.78534 - Accuracy: 131.0 - Proivder: fused
11-29 17:40:06.106 20319-20319/farmcloud.gpstest I/1894: 04:19 - Distance: 772.657 - Accuracy: 232.21 - Proivder: fused
11-29 17:40:06.106 20319-20319/farmcloud.gpstest I/1895: 04:21 - Distance: 9.328314 - Accuracy: 25.0 - Proivder: fused
11-29 17:40:06.106 20319-20319/farmcloud.gpstest I/1896: 04:21 - Distance: 693.4839 - Accuracy: 110.0 - Proivder: gps
11-29 17:40:06.106 20319-20319/farmcloud.gpstest I/1897: 04:23 - Distance: 693.0056 - Accuracy: 676.849 - Proivder: fused
11-29 17:40:06.106 20319-20319/farmcloud.gpstest I/1898: 04:23 - Distance: 679.2539 - Accuracy: 148.0 - Proivder: gps
11-29 17:40:06.106 20319-20319/farmcloud.gpstest I/1899: 04:23 - Distance: 679.25574 - Accuracy: 148.0 - Proivder: fused
11-29 17:40:06.106 20319-20319/farmcloud.gpstest I/1900: 04:23 - Distance: 686.7772 - Accuracy: 43.0 - Proivder: fused
11-29 17:40:06.106 20319-20319/farmcloud.gpstest I/1901: 04:24 - Distance: 707.85034 - Accuracy: 55.0 - Proivder: fused
11-29 17:40:06.106 20319-20319/farmcloud.gpstest I/1902: 04:25 - Distance: 707.85034 - Accuracy: 333.62 - Proivder: fused
11-29 17:40:06.106 20319-20319/farmcloud.gpstest I/1903: 04:25 - Distance: 683.21533 - Accuracy: 88.0 - Proivder: gps
11-29 17:40:06.106 20319-20319/farmcloud.gpstest I/1904: 04:25 - Distance: 683.21783 - Accuracy: 88.0 - Proivder: fused
11-29 17:40:06.106 20319-20319/farmcloud.gpstest I/1905: 04:27 - Distance: 9.328314 - Accuracy: 25.0 - Proivder: fused
11-29 17:40:06.106 20319-20319/farmcloud.gpstest I/1906: 04:28 - Distance: 748.212 - Accuracy: 124.0 - Proivder: gps
11-29 17:40:06.106 20319-20319/farmcloud.gpstest I/1907: 04:28 - Distance: 748.21686 - Accuracy: 124.0 - Proivder: fused
11-29 17:40:06.106 20319-20319/farmcloud.gpstest I/1908: 04:29 - Distance: 743.08234 - Accuracy: 709.707 - Proivder: fused
11-29 17:40:06.106 20319-20319/farmcloud.gpstest I/1909: 04:30 - Distance: 743.1258 - Accuracy: 75.0 - Proivder: gps
11-29 17:40:06.106 20319-20319/farmcloud.gpstest I/1910: 04:30 - Distance: 743.1303 - Accuracy: 75.0 - Proivder: fused
11-29 17:40:06.106 20319-20319/farmcloud.gpstest I/1911: 04:32 - Distance: 742.66644 - Accuracy: 611.683 - Proivder: fused
11-29 17:40:06.106 20319-20319/farmcloud.gpstest I/1912: 04:32 - Distance: 741.3365 - Accuracy: 147.0 - Proivder: gps
11-29 17:40:06.106 20319-20319/farmcloud.gpstest I/1913: 04:32 - Distance: 741.33484 - Accuracy: 147.0 - Proivder: fused
11-29 17:40:06.106 20319-20319/farmcloud.gpstest I/1914: 04:32 - Distance: 741.22455 - Accuracy: 143.0 - Proivder: fused
11-29 17:40:06.106 20319-20319/farmcloud.gpstest I/1915: 04:34 - Distance: 741.22455 - Accuracy: 556.811 - Proivder: fused
来源:https://stackoverflow.com/questions/33634547/does-google-location-services-return-old-locations