public void stopLogging() { started = false; locationManager.removeUpdates(locationListener); context.unregisterReceiver(wr01); if (accOpen) { fwRawAccel.closeFileOnCard(); } if (compOpen) { fwRawCompass.closeFileOnCard(); } }
private void writeTofwObject(FWriter fw, String data) { boolean retry = true; int tries = 0; while (retry && tries < 3) { try { fw.openFileOnCard(); fw.appendLineToFile(data); fw.closeFileOnCard(); retry = false; } catch (FileNotFoundException e) { // e.printStackTrace(); tries++; } } }
@Override public void onLocationChanged(Location location) { try { fwGPS.openFileOnCard(); fwGPS.appendLineToFile( "" + System.currentTimeMillis() + "," + location.getLatitude() + "," + location.getLongitude()); fwGPS.closeFileOnCard(); } catch (FileNotFoundException e) { e.printStackTrace(); } }