public LocationAssert hasBearing(float bearing) { isNotNull(); float actualBearing = actual.getBearing(); assertThat(actualBearing) // .overridingErrorMessage("Expected bearing <%s> but was <%s>.", bearing, actualBearing) // .isEqualTo(bearing); return this; }
coordinates.put(PARAM_HEADING, location.getBearing());
private Location copyOf(Location location) { if (location == null) return null; Location copy = new Location(location); copy.setAccuracy(location.getAccuracy()); copy.setAltitude(location.getAltitude()); copy.setBearing(location.getBearing()); copy.setExtras(location.getExtras()); copy.setLatitude(location.getLatitude()); copy.setLongitude(location.getLongitude()); copy.setProvider(location.getProvider()); copy.setSpeed(location.getSpeed()); copy.setTime(location.getTime()); return copy; }
public void onLocationChanged(Location location) { // ... process location updateCameraBearing(googleMap, location.getBearing()); }
/** * Formats the bearing from the #Location into a string. If the * bearing is unknown, it returns an empty string. */ public static String formatBearing(Location location) { String s = ""; if (location.hasBearing()) s += location.getBearing(); return s; }
LocationManager lm; Location location; lm = (LocationManager) getApplicationContext().getSystemService(Context.LOCATION_SERVICE); location = lm.getLastKnownLocation(LocationManager.GPS_PROVIDER); location.getBearing();//speed
public void onLocationChanged(Location location, GpsLocationProvider source) { // If we had a previous location, let's get those bounds if (mLocation != null && mLocation.getBearing() == location.getBearing() && mLocation.distanceTo(location) == 0) { return; } updateMyLocation(location); synchronized (mRunOnFirstFix) { for (final Runnable runnable : mRunOnFirstFix) { new Thread(runnable).start(); } mRunOnFirstFix.clear(); } }
public float getBearing() { return _Location.hasBearing() ? _Location.getBearing() : NOT_AVAILABLE; } public long getTime() { return _Location.getTime(); }
@Override public void onLocationChanged(Location location) { if (!mShowIndoorLocation) { Log.d(TAG, "new LocationService location received with coordinates: " + location.getLatitude() + "," + location.getLongitude()); showBlueDot( new LatLng(location.getLatitude(), location.getLongitude()), location.getAccuracy(), location.getBearing()); } }
public LocationAssert hasBearing(float bearing) { isNotNull(); float actualBearing = actual.getBearing(); assertThat(actualBearing) // .overridingErrorMessage("Expected bearing <%s> but was <%s>.", bearing, actualBearing) // .isEqualTo(bearing); return this; }
@Override public void onLocationChanged(final Location location) { double systemTimestamp = System.currentTimeMillis() / 1e3d - mStartTime; if (mListener == null) { return; } mListener.onNewValues(systemTimestamp, location.getTime() / 1e3d - mStartTime, new Object[]{location.getLatitude(), location.getLongitude(), location.getAltitude(), location.getBearing(), location.getAccuracy(), location.getSpeed()}); }
public List<Log.IniRecord> getExtraIniRecords(Context context, String sectionName, String provider) { if (!checkPermission(context)) return new ArrayList<>(); Location location = getLocationManager(context).getLastKnownLocation(provider); if (location == null) return new ArrayList<>(); List<Log.IniRecord> records = new ArrayList<>(); records.add(new Log.IniRecord(sectionName, INI_OPTION_LATITUDE, location.getLatitude())); records.add(new Log.IniRecord(sectionName, INI_OPTION_LONGITUDE, location.getLongitude())); records.add(new Log.IniRecord(sectionName, INI_OPTION_ALTITUDE, location.getAltitude())); records.add(new Log.IniRecord(sectionName, INI_OPTION_UNIXTIME, String.format(Locale.US, "%.3f", location.getTime() / 1e3d))); records.add(new Log.IniRecord(sectionName, INI_OPTION_ACCURACY, location.getAccuracy())); records.add(new Log.IniRecord(sectionName, INI_OPTION_BEARING, location.getBearing())); return records; } }
/** * Create a new SerialziableLocation with the values of the given Location. */ public SerializableLocation(Location location) { this.latitude = location.getLatitude(); this.longitude = location.getLongitude(); this.accuracy = location.getAccuracy(); this.altitude = location.getAltitude(); this.bearing = location.getBearing(); this.provider = location.getProvider(); this.speed = location.getSpeed(); this.time = location.getTime(); this.hasAccuracy = location.hasAccuracy(); this.hasAltitude = location.hasAltitude(); this.hasBearing = location.hasBearing(); this.hasSpeed = location.hasSpeed(); }
@Implementation public void set(Location l) { time = l.getTime(); provider = l.getProvider(); latitude = l.getLatitude(); longitude = l.getLongitude(); accuracy = l.getAccuracy(); bearing = l.getBearing(); altitude = l.getAltitude(); speed = l.getSpeed(); hasAccuracy = l.hasAccuracy(); hasAltitude = l.hasAltitude(); hasBearing = l.hasBearing(); hasSpeed = l.hasSpeed(); }
@Implementation public void set(Location l) { time = l.getTime(); provider = l.getProvider(); latitude = l.getLatitude(); longitude = l.getLongitude(); accuracy = l.getAccuracy(); bearing = l.getBearing(); altitude = l.getAltitude(); speed = l.getSpeed(); hasAccuracy = l.hasAccuracy(); hasAltitude = l.hasAltitude(); hasBearing = l.hasBearing(); hasSpeed = l.hasSpeed(); }
@Override public void onLocationChanged(Location location) { altitude = location.getAltitude(); heading = location.getBearing(); speed = location.getSpeed(); handleMessage(new SimpleVehicleMessage("phone_altitude", altitude)); handleMessage(new SimpleVehicleMessage("phone_heading", heading)); handleMessage(new SimpleVehicleMessage("phone_speed", speed)); } }
private Location copyOf(Location location) { if (location == null) return null; Location copy = new Location(location); copy.setAccuracy(location.getAccuracy()); copy.setAltitude(location.getAltitude()); copy.setBearing(location.getBearing()); copy.setExtras(location.getExtras()); copy.setLatitude(location.getLatitude()); copy.setLongitude(location.getLongitude()); copy.setProvider(location.getProvider()); copy.setSpeed(location.getSpeed()); copy.setTime(location.getTime()); return copy; }
private Location copyOf(Location location) { if (location == null) return null; Location copy = new Location(location); copy.setAccuracy(location.getAccuracy()); copy.setAltitude(location.getAltitude()); copy.setBearing(location.getBearing()); copy.setExtras(location.getExtras()); copy.setLatitude(location.getLatitude()); copy.setLongitude(location.getLongitude()); copy.setProvider(location.getProvider()); copy.setSpeed(location.getSpeed()); copy.setTime(location.getTime()); return copy; }
private Location copyOf(Location location) { if (location == null) return null; Location copy = new Location(location); copy.setAccuracy(location.getAccuracy()); copy.setAltitude(location.getAltitude()); copy.setBearing(location.getBearing()); copy.setExtras(location.getExtras()); copy.setLatitude(location.getLatitude()); copy.setLongitude(location.getLongitude()); copy.setProvider(location.getProvider()); copy.setSpeed(location.getSpeed()); copy.setTime(location.getTime()); return copy; }
private Location copyOf(Location location) { if (location == null) return null; Location copy = new Location(location); copy.setAccuracy(location.getAccuracy()); copy.setAltitude(location.getAltitude()); copy.setBearing(location.getBearing()); copy.setExtras(location.getExtras()); copy.setLatitude(location.getLatitude()); copy.setLongitude(location.getLongitude()); copy.setProvider(location.getProvider()); copy.setSpeed(location.getSpeed()); copy.setTime(location.getTime()); return copy; }