|
@@ -13,6 +13,20 @@ import java.io.FileOutputStream;
|
|
|
import java.io.FileWriter;
|
|
|
import java.io.IOException;
|
|
|
|
|
|
+/*
|
|
|
+The interface for the actual logging of sensor data while the user taps on the screen
|
|
|
+shows the picture of a keyboard, logs the sensor data in all directions from the motion sensor and the gyroscope (maybe neglate one axis)
|
|
|
+into a file with unique filename (year, month, day, time) + taps in that session
|
|
|
+output will be a column oriented csv file
|
|
|
+ACC-X | ACC-Y | ACC-Z | GYR-X | GYR-Y | GYR-Z | TOUCH (0/1) | LOC-X | LOC-Y
|
|
|
+This allows a postprocessing with matlab to cut the windows of the touch events and also allows for data augmentation later on
|
|
|
+windows of fixed size will be extracted
|
|
|
+-> check how long most touch events last since we have a fixed window size
|
|
|
+shows a heatmap of the touches within the last session, shows a counter
|
|
|
+has a button to end the record, to pause it and to resume it
|
|
|
+
|
|
|
+ */
|
|
|
+
|
|
|
public class TouchInterface extends AppCompatActivity {
|
|
|
|
|
|
private File recordFolder;
|
|
@@ -43,7 +57,7 @@ public class TouchInterface extends AppCompatActivity {
|
|
|
} catch (IOException e) {
|
|
|
e.printStackTrace();
|
|
|
}*/
|
|
|
-
|
|
|
+ //Files storage directory is under Main Storage - Android - Data - com.motionlogger.sebastianvendt.motionlogger - files
|
|
|
File path = this.getExternalFilesDir(null);
|
|
|
recordFile = new File(path, "myFile.txt");
|
|
|
FileOutputStream stream = null;
|
|
@@ -54,7 +68,7 @@ public class TouchInterface extends AppCompatActivity {
|
|
|
}
|
|
|
|
|
|
try {
|
|
|
- stream.write("texttextext".getBytes());
|
|
|
+ stream.write("test".getBytes());
|
|
|
stream.close();
|
|
|
} catch (java.io.IOException e) {
|
|
|
e.printStackTrace();
|