diff --git a/app/build.gradle b/app/build.gradle
index abf54e8..89d97d1 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -37,6 +37,8 @@ dependencies {
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
+ implementation 'com.jjoe64:graphview:4.2.2'
+
// Required for CameraX
def camerax_version = "1.2.3"
implementation "androidx.camera:camera-core:${camerax_version}"
diff --git a/app/src/main/java/com/example/ueberwachungssystem/MainActivity.java b/app/src/main/java/com/example/ueberwachungssystem/MainActivity.java
index dbce374..e9974f1 100644
--- a/app/src/main/java/com/example/ueberwachungssystem/MainActivity.java
+++ b/app/src/main/java/com/example/ueberwachungssystem/MainActivity.java
@@ -12,13 +12,15 @@ import android.content.pm.PackageManager;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
+import android.widget.Switch;
import android.widget.TextView;
import android.widget.Toast;
import android.widget.ToggleButton;
import android.widget.VideoView;
-import com.example.ueberwachungssystem.Detection.DetectionReport;
-import com.example.ueberwachungssystem.Detection.Detector;
+import com.example.ueberwachungssystem.logger.Logger;
+import com.jjoe64.graphview.GraphView;
+
import com.example.ueberwachungssystem.Detection.VideoDetector;
import java.io.File;
@@ -41,8 +43,27 @@ public class MainActivity extends AppCompatActivity {
File directory = getFilesDir();
+ TextView tv_log = (TextView) findViewById(R.id.tv_log); //Set textview for showing logged content
+ //Logger logger = new Logger(this.getClass().getSimpleName(), tv_log, "");
+ //logger.log(this.getClass().getSimpleName() + ".onCreate");
+ //GraphView graph = new GraphView(this);
- AudioRecorder ar = new AudioRecorder(this);
+
+
+ VideoDetector vd = new VideoDetector(this);
+ vd.setPreviewView(previewView);
+ vd.setOnDetectionListener(new com.example.ueberwachungssystem.Detection.Detector.OnDetectionListener() {
+ @Override
+ public void onDetection(@NonNull com.example.ueberwachungssystem.Detection.DetectionReport detectionReport) {
+ Log.d("videoDetection", detectionReport.toString());
+ }
+ });
+
+
+
+
+
+ //AudioRecorder ar = new AudioRecorder(this);
//DetectionRecorder detectionRecorder = new DetectionRecorder(this);
@@ -60,14 +81,16 @@ public class MainActivity extends AppCompatActivity {
if (isRecordVideoAllowed() && toggleButton.isChecked())
{
- ar.startRecording();
+ //ar.startRecording();
+ vd.startRecording();
//vd.startRecording();
//vd.playVideo(videoView);
//detectionRecorder.playVideo(videoView);
//detectionRecorder.start();
}
else {
- ar.stopRecording();
+ vd.stopRecording();
+ //ar.stopRecording();
//vd.stopRecording();
//detectionRecorder.stop();
@@ -80,10 +103,11 @@ public class MainActivity extends AppCompatActivity {
public void onClick(View v) {
if (toggleButton.isChecked())
{
- ar.playAudio();
+ //ar.playAudio();
+ vd.playVideo(videoView);
}
else {
- ar.deleteRecording();
+ //ar.deleteRecording();
}
}
});
diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml
index da7d34c..42f5a64 100644
--- a/app/src/main/res/layout/activity_main.xml
+++ b/app/src/main/res/layout/activity_main.xml
@@ -9,6 +9,12 @@
android:orientation="vertical"
tools:context=".MainActivity">
+
+