use of org.odk.collect.location.Location in project collect by opendatakit.
the class GeoPolyActivity method startInput.
@Override
public void startInput() {
inputActive = true;
if (recordingEnabled && recordingAutomatic) {
boolean retainMockAccuracy = getIntent().getBooleanExtra(Constants.EXTRA_RETAIN_MOCK_ACCURACY, false);
locationTracker.start(retainMockAccuracy);
recordPoint(map.getGpsLocation());
schedulerHandler = scheduler.scheduleAtFixedRate(() -> runOnUiThread(() -> {
Location currentLocation = locationTracker.getCurrentLocation();
if (currentLocation != null) {
MapPoint currentMapPoint = new MapPoint(currentLocation.getLatitude(), currentLocation.getLongitude(), currentLocation.getAltitude(), currentLocation.getAccuracy());
recordPoint(currentMapPoint);
}
}), INTERVAL_OPTIONS[intervalIndex], INTERVAL_OPTIONS[intervalIndex], TimeUnit.SECONDS);
}
updateUi();
}