Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
305 views
in Technique[技术] by (71.8m points)

android - FusedLocationApi Performance Issue: Accuracy seems capped at 10.0 meters

I'm experiencing a strange problem where the FusedLocationProviderAPI does not give me a better Accuracy number then 10.0 meters. It starts like normal giving me a high number of, for example, 56 meters... 24... 13... and then stays at 10.0. Seemingly capped at giving no better then that.

Tried on Phone Sony Xperia Z2 & Huawei Honor 8

location.getAccuracy() //Seems capped at 10.0 meters

The strange part is that I was receiving an Accuracy number down to around 3.0 meters with good weather outside and I have no memory of changing the phones GPS options / nor any options related to the GPS Service Class.

My app is dependant on being able to get the highest accuracy number possible. What could be the issue here? The Phone itself? The settings of the request? Possible reasons of the capped number?

Edit: Experienced the same problem when trying on the Huwaei. So there seems to be an issue with the code? Like after x amount of location requests accuracy gets capped at 10.0 from system??

Relevant things from my GPS service:

Manifest

<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.INTERNET" />

Service

private long UPDATE_INTERVAL = 2 * 1000;  /* 10 secs */
private long FASTEST_INTERVAL = 2000; /* 2 sec */
static final int MY_PERMISSIONS_REQUEST_ACCESS_FINE_LOCATION = 1;

private void requestLocation() {
    locationRequest = new LocationRequest();
    locationRequest.setInterval(UPDATE_INTERVAL);
    locationRequest.setFastestInterval(FASTEST_INTERVAL);
    locationRequest.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY);
    gac = new GoogleApiClient.Builder(this)
            .addConnectionCallbacks(this)
            .addOnConnectionFailedListener(this)
            .addApi(LocationServices.API)
            .build();
}

@Override
public void onLocationChanged(Location location) {

    locationData = location; //1. Set local field to incoming location
    gpsAccuracy = location.getAccuracy(); //2. Est. horizontal accuracy of location, radial, in meters.
}
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

It looks like 10 m is the best approx accuracy you can get with FusedLocationServicesApi, with HIGH_ACCURACY as the priority. However, I believe it might be possible to get better accuracy by using LocationManager. Check out this article: http://www.tothenew.com/blog/googles-fused-location-api-for-android/


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

2.1m questions

2.1m answers

60 comments

56.9k users

...