Android Fused Location Api is not using GPS even with PRIORITY_HIGH_ACCURACY?

1.3k views Asked by At

I am developing a tracking application for buses, I need to use GPS only, I followed this tutorial , however it only use network location not GPS even when using PRIORITY_HIGH_ACCURACY !!

protected void createLocationRequest() {
    mLocationRequest = new LocationRequest();
    mLocationRequest.setInterval(UPDATE_INTERVAL_IN_MILLISECONDS);
    mLocationRequest.setFastestInterval(FASTEST_UPDATE_INTERVAL_IN_MILLISECONDS);
    mLocationRequest.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY);
}

protected void startLocationUpdates() {
            LocationServices.FusedLocationApi.requestLocationUpdates(
            mGoogleApiClient, mLocationRequest, this);
}
  • My phone's location priority is high accuracy.
  • GPS is enabled
  • both fine and coarse permission are used
  • the result are not accurate at all
  • when using Google maps application, the GPS icon appears and the location gets more accurate
0

There are 0 answers