예제 #1
0
 public void stopLogging() {
   started = false;
   locationManager.removeUpdates(locationListener);
   context.unregisterReceiver(wr01);
   if (accOpen) {
     fwRawAccel.closeFileOnCard();
   }
   if (compOpen) {
     fwRawCompass.closeFileOnCard();
   }
 }
예제 #2
0
 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++;
     }
   }
 }
예제 #3
0
 @Override
 public void onLocationChanged(Location location) {
   try {
     fwGPS.openFileOnCard();
     fwGPS.appendLineToFile(
         ""
             + System.currentTimeMillis()
             + ","
             + location.getLatitude()
             + ","
             + location.getLongitude());
     fwGPS.closeFileOnCard();
   } catch (FileNotFoundException e) {
     e.printStackTrace();
   }
 }