@@ -0,0 +1,1317 @@
+/*%0A * LocationLogger.java%0A *%0A * Simple class to record obtained locations in external%0A * storage (usually SD card) for debugging/testing purposes%0A *%0A */%0Apackage com.incidentlocator.client;%0A%0Aimport android.location.Location;%0Aimport android.content.Context;%0Aimport android.util.Log;%0Aimport android.os.Environment;%0A%0Aimport java.io.File;%0Aimport java.io.FileWriter;%0Aimport java.io.BufferedWriter;%0Aimport java.io.IOException;%0A%0Apublic class LocationLogger %7B%0A%0A    private static final String TAG = %22IncidentLocatorExternalLogger%22;%0A    private static final String extFile = %22locations.log%22;%0A%0A    public void saveLocation(Location loc, Context context) %7B%0A        File extDir = context.getExternalFilesDir(null);%0A        if (Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED)) %7B%0A            try %7B%0A                File fp = new File(extDir, extFile);%0A                // open file for append%0A                FileWriter fw = new FileWriter(fp, true);%0A                BufferedWriter f = new BufferedWriter(fw);%0A                f.write(loc.toString()+%22%5Cn%22);%0A                f.close();%0A                Log.d(TAG, %22wrote to external log%22);%0A            %7D catch (IOException e) %7B%0A                Log.w(TAG, e);%0A            %7D%0A        %7D else %7B%0A            Log.w(TAG, %22external storage not mounted%22);%0A        %7D%0A    %7D%0A%7D%0A

add LocationLogger.java