public Location toSysLocation() { Location location = new Location(LocationManager.GPS_PROVIDER); location.setAccuracy(8f); Bundle extraBundle = new Bundle(); location.setBearing(bearing); Reflect.on(location).call("setIsFromMockProvider", false); location.setLatitude(latitude); location.setLongitude(longitude); location.setSpeed(speed); location.setTime(System.currentTimeMillis()); location.setExtras(extraBundle); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) { location.setElapsedRealtimeNanos(277000000); } int svCount = VirtualGPSSatalines.get().getSvCount(); extraBundle.putInt("satellites", svCount); extraBundle.putInt("satellitesvalue", svCount); return location; } }
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 Location toSysLocation() { Location location = new Location(LocationManager.GPS_PROVIDER); location.setAccuracy(8f); Bundle extraBundle = new Bundle(); location.setBearing(bearing); Reflect.on(location).call("setIsFromMockProvider", false); location.setLatitude(latitude); location.setLongitude(longitude); location.setSpeed(speed); location.setTime(System.currentTimeMillis()); location.setExtras(extraBundle); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) { location.setElapsedRealtimeNanos(277000000); } int svCount = VirtualGPSSatalines.get().getSvCount(); extraBundle.putInt("satellites", svCount); extraBundle.putInt("satellitesvalue", svCount); return location; } }
public Location toSysLocation() { Location location = new Location(LocationManager.GPS_PROVIDER); location.setAccuracy(8f); Bundle extraBundle = new Bundle(); location.setBearing(bearing); Reflect.on(location).call("setIsFromMockProvider", false); location.setLatitude(latitude); location.setLongitude(longitude); location.setSpeed(speed); location.setTime(System.currentTimeMillis()); location.setExtras(extraBundle); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) { location.setElapsedRealtimeNanos(277000000); } int svCount = VirtualGPSSatalines.get().getSvCount(); extraBundle.putInt("satellites", svCount); extraBundle.putInt("satellitesvalue", svCount); return location; } }
private void sendLocation(GpxTrackPoint point) { Location loc = new Location(providerName); loc.setLatitude(point.getLat()); loc.setLongitude(point.getLon()); loc.setTime(System.currentTimeMillis()); loc.setBearing((float) point.getHeading()); loc.setAccuracy(1.0f); loc.setSpeed((float) point.getSpeed()); loc.setAltitude(100.0); // bk added Method method; try { method = Location.class.getMethod("makeComplete", new Class[0]); if (method != null) { try { method.invoke(loc, new Object[0]); } catch (Exception exception) { } } } catch (NoSuchMethodException e) { e.printStackTrace(); } Log.d("SendLocation", "Sending update for " + providerName); mLocationManager.setTestProviderLocation(providerName, loc); }
Math.cos(Math.toRadians(location.getLatitude())); float speed = (float) Math.sqrt((latVeolocity*latVeolocity)+(lonVeolocity*lonVeolocity)); location.setSpeed(speed);
location.setLatitude(latitude); location.setLongitude(longitude); location.setSpeed(speed); location.setBearing(bearing);
if (lcdata_float != NOT_AVAILABLE) lc.setSpeed(lcdata_float);
if (lcdata_float != NOT_AVAILABLE) lc.setSpeed(lcdata_float);
loc.setLongitude(Core.startLon); loc.setProvider(mocLocationProvider); loc.setSpeed(0.8f); loc.setBearing((float) Core.azimuth); loc.setTime(System.currentTimeMillis());
if (lcdata_float != NOT_AVAILABLE) lc.setSpeed(lcdata_float);
l.setAccuracy(r.nextFloat()); l.setAltitude((r.nextDouble() * 2000) - 1000); l.setSpeed(r.nextFloat() * 200); l.setTime(System.currentTimeMillis()); helper.track(trackId, l, DataHelper.AZIMUTH_INVALID, 0); l.setAccuracy(r.nextFloat()); l.setAltitude((r.nextDouble() * 2000) - 1000); l.setSpeed(r.nextFloat() * 200); l.setTime(System.currentTimeMillis());
l.setAccuracy((Float) mock[2]); l.setAltitude((Double) mock[3]); l.setSpeed((Float) mock[4]); l.setTime(c.getTime().getTime()); helper.track(trackId, l, DataHelper.AZIMUTH_INVALID, 0); l.setAccuracy((Float) mock[2]); l.setAltitude((Double) mock[3]); l.setSpeed((Float) mock[4]); l.setTime(c.getTime().getTime());
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; }
location.setLatitude(latitude.getValue().doubleValue()); location.setLongitude(longitude.getValue().doubleValue()); location.setSpeed((float) speed.getValue().doubleValue());
location.setSpeed(mLastLocation.getSpeed());