Google provides the fused location provider API to obtain location co-ordinates. According to the documentation, the API internally polls location data from different providers (GPS, Wifi, Cellular networks) and provides the best location. But, in High Accuracy mode, I have collected the below information. In this test GPS is always ON.
Latitude: 12.8560136
Longitude: 80.1997696
User Activity: IN VEHICLE
Speed: 21.810165 mph
Altitude: -83.0
Accuracy: 12.0
When I see this point in map, the points are not in the road. They are slightly away from the road. Other points with the same accuracy are plotted in the road.When I full zoom and see, some of the points are slightly away from the traveled road path.
I want the accurate information. It points must be in the road path.
I have used the Fused Location API to get the location information.
mGoogleApiClient = new GoogleApiClient.Builder(mContext)
.addApi(LocationServices.API).addConnectionCallbacks(this)
.addOnConnectionFailedListener(this).build();
Share your suggestion. If I use the Location manager will it solve my problem. And also I need to consume less battery only. Fused API guarantees that it consumes only less power and more efficient.
And also Fused Location API has below issues,
- Not able to get the satellite count.
- Is always returning the FUSED provider. Not exactly gives which provider(GPS or Network) returns the Location information.
- Your never notified when both the provider is unavailable . It will not return any value when none of the provider is available. To check the provider availability we need to separately register with Location manager. which consumes more power.
Please help me on this. Thanks in advance.
You won't beat the fused provider accuracy or power use with a straight up location provider.
The fused location provider reports speed as meters per second and accuracy in meters. The example point you have is accurate to 12 meters. A US lane is defined as 3.7m. With 12m of accuracy you could be off by 12/3.7=3.25 lanes in any direction. I can't say this enough. If you want accuracy you have to check the accuracy of the location.
How to get more accuracy by GPS_PROVIDER
LatLng and distance between returning incorrect values on newer phones
can't find the exact current location in android
Android Maps GPS outlier
Fused Location Provider unexpected behavior
Adjust your program to handle the accuracy of the point. For example assume the point is correct shade a circle around the point with a radius = the accuracy in the location.