Code example for Location

Methods: getAltitudegetBearinggetLatitudegetLongitudegetSpeedgetTimehasAltitudehasSpeed

0
   * Add a point to the tracklog 
   *  
   * @param location 
   */ 
  private void emitPosition(Location location) {
    double lat = location.getLatitude();
    double longitude = location.getLongitude();
    float kmPerHr = location.hasSpeed() ? (float) (location.getSpeed() * 3.6)
        : Float.NaN;
    // convert m/sec to km/hr 
 
    float[] accelVals = (accel != null) ? accel.getValues() : null;
    float vspd = (baro != null) ? baro.getVerticalSpeed() : Float.NaN;
 
    // The emulator will falsely claim 0 for the first point reported - 
    // skip it 
    if (lat != 0.0)
      dest.emitPosition(location.getTime(), lat, longitude,
          location.hasAltitude() ? (float) location.getAltitude() : Float.NaN,
          (int) location.getBearing(), kmPerHr, accelVals, vspd);
  } 
 
  @Override 
  public void onLocationChanged(Location location) {