Exemplo n.º 1
0
  public boolean Add(Location location) {

    if (location.getAccuracy() < EXCELLENT_ACCURACY) {
      currentAccuracy = ACCURACY.EXCELLENT;
    } else if (location.getAccuracy() < GOOOD_ACCURACY) {
      currentAccuracy = ACCURACY.GOOD;
    } else if (location.getAccuracy() < AVERAGE_ACCURACY) {
      currentAccuracy = ACCURACY.AVERAGE;
    } else if (location.getAccuracy() < LOW_ACCURACY) {
      currentAccuracy = ACCURACY.BAD;
    } else if (location.getAccuracy() < VERY_LOW_ACCURACY) {
      currentAccuracy = ACCURACY.VERY_BAD;
    }

    if (location.getAccuracy() > LOW_ACCURACY && connectTries < MAX_CONNECT_TRIES) {
      connectTries++;
      return false;
    }

    connectTries = 0;
    buffer.Add(location);
    return true;
  }
Exemplo n.º 2
0
 public float DistanceToDestination(LatLng destination) {
   return buffer.DistanceToDestination(destination);
 }
Exemplo n.º 3
0
 public float TimeToDestination(LatLng destination) {
   return buffer.TimeToDestination(destination);
 }
Exemplo n.º 4
0
 public float getAverageSpeed() {
   return buffer.getAverageSpeed();
 }