This commit is contained in:
y20k 2016-10-04 11:11:13 +02:00
parent 292a1bb007
commit a6dd91b348
2 changed files with 3 additions and 3 deletions

View file

@ -139,8 +139,8 @@ public final class LocationHelper implements TrackbookKeys {
public static boolean isNewWayPoint(Location lastLocation, Location newLocation, float averageSpeed) { public static boolean isNewWayPoint(Location lastLocation, Location newLocation, float averageSpeed) {
float distance = newLocation.distanceTo(lastLocation); float distance = newLocation.distanceTo(lastLocation);
long timeDifference = newLocation.getElapsedRealtimeNanos() - lastLocation.getElapsedRealtimeNanos(); long timeDifference = newLocation.getElapsedRealtimeNanos() - lastLocation.getElapsedRealtimeNanos();
String providerLastLocation = lastLocation.getProvider(); // String providerLastLocation = lastLocation.getProvider();
String providerNewLocation = newLocation.getProvider(); // String providerNewLocation = newLocation.getProvider();
if (newLocation.getProvider().equals(LocationManager.NETWORK_PROVIDER)) { if (newLocation.getProvider().equals(LocationManager.NETWORK_PROVIDER)) {
// calculate speed difference // calculate speed difference

View file

@ -85,7 +85,7 @@ public class StorageHelper implements TrackbookKeys {
recordingStart = track.getRecordingStart(); recordingStart = track.getRecordingStart();
} }
if (mFolder.exists() && mFolder.isDirectory() && mFolder.canWrite() && recordingStart != null && track != null) { if (mFolder != null && mFolder.exists() && mFolder.isDirectory() && mFolder.canWrite() && recordingStart != null && track != null) {
// construct filename from track recording date // construct filename from track recording date
DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd-HH-mm-ss", Locale.US); DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd-HH-mm-ss", Locale.US);
String fileName = dateFormat.format(recordingStart) + mFileExtension; String fileName = dateFormat.format(recordingStart) + mFileExtension;