Compare commits
107
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
076db89147 | ||
|
|
061646a7d6 | ||
|
|
6f78836c4d | ||
|
|
b667e70fef | ||
|
|
272daf9fae | ||
|
|
55ae95e661 | ||
|
|
8e47934beb | ||
|
|
c60a14b6ac | ||
|
|
b9c66f7533 | ||
|
|
7e1143880e | ||
|
|
4381ae78f8 | ||
|
|
c198292fbf | ||
|
|
81c3542654 | ||
|
|
35d52088aa | ||
|
|
81e04e370a | ||
|
|
d33ab299ab | ||
|
|
f8f1fd23fb | ||
|
|
e01e23eccd | ||
|
|
a493bafb79 | ||
|
|
aed079377f | ||
|
|
bff6abbd29 | ||
|
|
5d31f0bb46 | ||
|
|
ea0e88ed89 | ||
|
|
7dee124378 | ||
|
|
0ee1446cbc | ||
|
|
bc5227ba4f | ||
|
|
4185cb5200 | ||
|
|
0a3600d0d6 | ||
|
|
9b2d57ad37 | ||
|
|
847e90f5ac | ||
|
|
ab41217f0e | ||
|
|
e088b0afa3 | ||
|
|
493fa8ca83 | ||
|
|
6954d38143 | ||
|
|
8a5d720685 | ||
|
|
057c7fc139 | ||
|
|
29c193b716 | ||
|
|
90aea5b1bc | ||
|
|
76442888f7 | ||
|
|
8a357e0d26 | ||
|
|
83268c763b | ||
|
|
3d02d8d4c0 | ||
|
|
cafe763c4a | ||
|
|
2cff334056 | ||
|
|
d32e0a11f5 | ||
|
|
b94a1d98b7 | ||
|
|
746eec18ba | ||
|
|
44e056b5fe | ||
|
|
df1fefef5f | ||
|
|
df9b28c830 | ||
|
|
6ec0b175e4 | ||
|
|
5bcd465ecc | ||
|
|
a6fdf3f774 | ||
|
|
b46db4cdfc | ||
|
|
6c4905d0e7 | ||
|
|
fb8bdcd895 | ||
|
|
402b73e4bd | ||
|
|
9e5b669986 | ||
|
|
8275d8bd5a | ||
|
|
7ef0df48dd | ||
|
|
50b579705e | ||
|
|
8551abfc5d | ||
|
|
bbd333426d | ||
|
|
74eb3e0d98 | ||
|
|
5f7e2a43f2 | ||
|
|
e98ae10267 | ||
|
|
07f60f974b | ||
|
|
7d29ed1ca9 | ||
|
|
f98079d431 | ||
|
|
11dbcd0362 | ||
|
|
047d45f1cb | ||
|
|
95919a6602 | ||
|
|
19d1bfe1e3 | ||
|
|
e9da712882 | ||
|
|
804c5aba36 | ||
|
|
c5577b125f | ||
|
|
6100d17bd2 | ||
|
|
74a291bdd6 | ||
|
|
ba6765b1fb | ||
|
|
9fce3be6a8 | ||
|
|
9892fc35bc | ||
|
|
62a528d33b | ||
|
|
7c8610facb | ||
|
|
4999f1b998 | ||
|
|
37617dbd54 | ||
|
|
569bd43163 | ||
|
|
fdb0036ea6 | ||
|
|
f9797f2dca | ||
|
|
ba75c58a23 | ||
|
|
620528302e | ||
|
|
3d799ae461 | ||
|
|
2501662737 | ||
|
|
d04d166e14 | ||
|
|
1576719d10 | ||
|
|
362af75b9a | ||
|
|
bef5d03494 | ||
|
|
80ebf77eb6 | ||
|
|
c4ed247a05 | ||
|
|
323786859e | ||
|
|
354bf937b2 | ||
|
|
39bb37f5c3 | ||
|
|
b198dc2e06 | ||
|
|
d83cd3dc32 | ||
|
|
90a2aad491 | ||
|
|
57bf2c2fb7 | ||
|
|
065acefeb9 | ||
|
|
5c0263198c |
@@ -0,0 +1,3 @@
|
|||||||
|
Sensor als Service einrichten, der aus Activity heraus gestartet werden kann.
|
||||||
|
Stichwort: Intent
|
||||||
|
Siehe Skript Teil 1
|
||||||
@@ -40,4 +40,21 @@ dependencies {
|
|||||||
testImplementation 'junit:junit:4.13.2'
|
testImplementation 'junit:junit:4.13.2'
|
||||||
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
|
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
|
||||||
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
|
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
|
||||||
|
|
||||||
|
|
||||||
|
// OpenCV (from: https://github.com/QuickBirdEng/opencv-android)
|
||||||
|
def opencv_version = "4.5.3.0"
|
||||||
|
implementation "com.quickbirdstudios:opencv:${opencv_version}"
|
||||||
|
|
||||||
|
implementation "androidx.lifecycle:lifecycle-extensions:2.0.0"
|
||||||
|
|
||||||
|
|
||||||
|
// Required for CameraX
|
||||||
|
def camerax_version = "1.2.2"
|
||||||
|
implementation "androidx.camera:camera-core:${camerax_version}"
|
||||||
|
implementation "androidx.camera:camera-camera2:${camerax_version}"
|
||||||
|
implementation "androidx.camera:camera-lifecycle:${camerax_version}"
|
||||||
|
implementation "androidx.camera:camera-video:${camerax_version}"
|
||||||
|
implementation "androidx.camera:camera-view:${camerax_version}"
|
||||||
|
implementation "androidx.camera:camera-extensions:${camerax_version}"
|
||||||
}
|
}
|
||||||
@@ -2,11 +2,13 @@
|
|||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:tools="http://schemas.android.com/tools">
|
xmlns:tools="http://schemas.android.com/tools">
|
||||||
|
|
||||||
|
<uses-feature android:name="android.hardware.camera"/>
|
||||||
|
<uses-permission android:name="android.permission.CAMERA"/>
|
||||||
|
<uses-permission android:name="android.permission.RECORD_AUDIO" />
|
||||||
|
|
||||||
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
|
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
|
||||||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
||||||
<uses-permission android:name="android.permission.INTERNET" />
|
<uses-permission android:name="android.permission.INTERNET" />
|
||||||
<uses-permission android:name="android.permission.CAMERA" /> <!-- §permissionCamera§ -->
|
|
||||||
<uses-permission android:name="android.permission.RECORD_AUDIO" />
|
|
||||||
|
|
||||||
<application
|
<application
|
||||||
android:allowBackup="true"
|
android:allowBackup="true"
|
||||||
@@ -14,20 +16,19 @@
|
|||||||
android:fullBackupContent="@xml/backup_rules"
|
android:fullBackupContent="@xml/backup_rules"
|
||||||
android:icon="@mipmap/ic_launcher"
|
android:icon="@mipmap/ic_launcher"
|
||||||
android:label="@string/app_name"
|
android:label="@string/app_name"
|
||||||
android:roundIcon="@mipmap/ic_launcher_round"
|
|
||||||
android:supportsRtl="true"
|
android:supportsRtl="true"
|
||||||
android:theme="@style/Theme.Ueberwachungssystem"
|
android:theme="@style/Theme.Ueberwachungssystem"
|
||||||
tools:targetApi="31">
|
tools:targetApi="31">
|
||||||
<activity
|
<activity
|
||||||
android:name=".MainActivity"
|
android:name=".MainActivity"
|
||||||
android:exported="true"
|
android:exported="true">
|
||||||
android:label="Ueberwachungsapp">
|
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.intent.action.MAIN" />
|
<action android:name="android.intent.action.MAIN" />
|
||||||
|
|
||||||
<category android:name="android.intent.category.LAUNCHER" />
|
<category android:name="android.intent.category.LAUNCHER" />
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
</activity>
|
</activity>
|
||||||
|
<service android:name=".Detection.DetectorService"/>
|
||||||
</application>
|
</application>
|
||||||
|
|
||||||
</manifest>
|
</manifest>
|
||||||
@@ -0,0 +1,53 @@
|
|||||||
|
package com.example.ueberwachungssystem.Fragments;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import android.net.Uri;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.os.Environment;
|
||||||
|
import android.util.Log;
|
||||||
|
import android.view.LayoutInflater;
|
||||||
|
import android.view.View;
|
||||||
|
import android.view.ViewGroup;
|
||||||
|
import android.widget.TextView;
|
||||||
|
import android.widget.VideoView;
|
||||||
|
|
||||||
|
import androidx.fragment.app.Fragment;
|
||||||
|
|
||||||
|
import com.example.ueberwachungssystem.R;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
|
||||||
|
public class Fragment1 extends Fragment {
|
||||||
|
private String text;
|
||||||
|
private final static String KEY_TEXT = "KEY_TEXT";
|
||||||
|
private void log(String nachricht) {
|
||||||
|
Log.d(this.getClass().getSimpleName(), nachricht);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle bundle) {
|
||||||
|
log("onCreateView");
|
||||||
|
View view = inflater.inflate(R.layout.fragment1, container, false);
|
||||||
|
TextView Sensor = (TextView) view.findViewById(R.id.Alarm);
|
||||||
|
Sensor.setText(text);
|
||||||
|
return view;
|
||||||
|
}
|
||||||
|
public static Fragment1 erstellen(String text) {
|
||||||
|
Fragment1 fragment = new Fragment1();
|
||||||
|
Bundle b = new Bundle();
|
||||||
|
b.putString(KEY_TEXT, text);
|
||||||
|
fragment.setArguments(b);
|
||||||
|
return fragment;
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public void onCreate(Bundle bundle) {
|
||||||
|
super.onCreate(bundle);
|
||||||
|
Bundle args = getArguments();
|
||||||
|
if (args != null ) {
|
||||||
|
text = args.getString(KEY_TEXT);
|
||||||
|
log("onCreate: text=" + text);
|
||||||
|
} else {
|
||||||
|
log("onCreate");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,66 @@
|
|||||||
|
package com.example.ueberwachungssystem.Fragments;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import android.content.Intent;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.util.Log;
|
||||||
|
import android.view.LayoutInflater;
|
||||||
|
import android.view.View;
|
||||||
|
import android.view.ViewGroup;
|
||||||
|
import android.widget.ArrayAdapter;
|
||||||
|
import android.widget.ListView;
|
||||||
|
import android.widget.TextView;
|
||||||
|
|
||||||
|
import androidx.fragment.app.Fragment;
|
||||||
|
|
||||||
|
import com.example.ueberwachungssystem.MeinAdapter;
|
||||||
|
import com.example.ueberwachungssystem.R;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class Fragment2 extends Fragment {
|
||||||
|
private String text;
|
||||||
|
private Context c;
|
||||||
|
private final static String KEY_TEXT = "KEY_TEXT" ;
|
||||||
|
private void log(String nachricht) {
|
||||||
|
Log.d(this.getClass().getSimpleName(), nachricht);
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle bundle) {
|
||||||
|
log( "onCreateView" );
|
||||||
|
View view = inflater.inflate(R.layout.fragment2, container, false );
|
||||||
|
// TextView Sensor = (TextView) view.findViewById(R.id.Aufzeichnungen);
|
||||||
|
// Sensor.setText(text);
|
||||||
|
return view;
|
||||||
|
}
|
||||||
|
public static Fragment2 erstellen(String text) {
|
||||||
|
Fragment2 fragment = new Fragment2();
|
||||||
|
Bundle b = new Bundle();
|
||||||
|
b.putString(KEY_TEXT, text);
|
||||||
|
fragment.setArguments(b);
|
||||||
|
return fragment;
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public void onCreate(Bundle bundle) {
|
||||||
|
super.onCreate(bundle);
|
||||||
|
Bundle args = getArguments();
|
||||||
|
c = getContext();
|
||||||
|
ListView listView = new ListView(c);
|
||||||
|
setContentView(R.layout.fragment2);
|
||||||
|
listView.setAdapter(new MeinAdapter(c, getVideoFiles()));
|
||||||
|
if (args != null) {
|
||||||
|
text = args.getString(KEY_TEXT);
|
||||||
|
log("onCreate: text=" + text);
|
||||||
|
} else {
|
||||||
|
log("onCreate");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public List<File> getVideoFiles(){
|
||||||
|
File directory = c.getFilesDir();
|
||||||
|
File[] files = directory.listFiles();
|
||||||
|
assert files != null;
|
||||||
|
return Arrays.asList(files);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,46 @@
|
|||||||
|
package com.example.ueberwachungssystem.Fragments;
|
||||||
|
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.util.Log;
|
||||||
|
import android.view.LayoutInflater;
|
||||||
|
import android.view.View;
|
||||||
|
import android.view.ViewGroup;
|
||||||
|
import android.widget.TextView;
|
||||||
|
|
||||||
|
import androidx.fragment.app.Fragment;
|
||||||
|
|
||||||
|
import com.example.ueberwachungssystem.R;
|
||||||
|
|
||||||
|
public class Fragment3 extends Fragment {
|
||||||
|
private String text;
|
||||||
|
private final static String KEY_TEXT = "KEY_TEXT" ;
|
||||||
|
private void log(String nachricht) {
|
||||||
|
Log.d(this.getClass().getSimpleName(), nachricht);
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle bundle) {
|
||||||
|
log( "onCreateView" );
|
||||||
|
View view = inflater.inflate(R.layout.fragment2, container, false );
|
||||||
|
TextView Sensor = (TextView) view.findViewById(R.id.Sensor);
|
||||||
|
Sensor.setText(text);
|
||||||
|
return view;
|
||||||
|
}
|
||||||
|
public static Fragment3 erstellen(String text) {
|
||||||
|
Fragment3 fragment = new Fragment3();
|
||||||
|
Bundle b = new Bundle();
|
||||||
|
b.putString(KEY_TEXT, text);
|
||||||
|
fragment.setArguments(b);
|
||||||
|
return fragment;
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public void onCreate(Bundle bundle) {
|
||||||
|
super.onCreate(bundle);
|
||||||
|
Bundle args = getArguments();
|
||||||
|
if (args != null) {
|
||||||
|
text = args.getString(KEY_TEXT);
|
||||||
|
log("onCreate: text=" + text);
|
||||||
|
} else {
|
||||||
|
log("onCreate");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,44 @@
|
|||||||
|
package com.example.ueberwachungssystem.Logger;
|
||||||
|
|
||||||
|
import android.util.Log;
|
||||||
|
import android.widget.TextView;
|
||||||
|
|
||||||
|
import java.io.PrintWriter;
|
||||||
|
import java.io.StringWriter;
|
||||||
|
|
||||||
|
public class Logger {
|
||||||
|
private TextView textView;
|
||||||
|
private StringBuffer sb = new StringBuffer();
|
||||||
|
private String tag;
|
||||||
|
|
||||||
|
public Logger(String tag, TextView textView, String logInitText) {
|
||||||
|
this.tag = tag;
|
||||||
|
this.textView = textView;
|
||||||
|
sb.append(logInitText);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void log(String s) {
|
||||||
|
Log.d(tag, s);
|
||||||
|
sb.append(s).append("\n");
|
||||||
|
if (textView != null) {
|
||||||
|
textView.setText(sb.toString());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void log(Exception e) {
|
||||||
|
StringWriter sw = new StringWriter();
|
||||||
|
e.printStackTrace(new PrintWriter(sw));
|
||||||
|
log(sw.toString());
|
||||||
|
}
|
||||||
|
|
||||||
|
public void clearLog() {
|
||||||
|
sb.setLength(0);
|
||||||
|
if (textView != null) {
|
||||||
|
textView.setText("");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getLoggedText() {
|
||||||
|
return sb.toString();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,103 +1,126 @@
|
|||||||
package com.example.ueberwachungssystem;
|
package com.example.ueberwachungssystem;
|
||||||
|
|
||||||
import android.annotation.SuppressLint;
|
import androidx.camera.core.ExperimentalGetImage;
|
||||||
import android.net.wifi.WifiInfo;
|
import androidx.fragment.app.Fragment;
|
||||||
import android.net.wifi.WifiManager;
|
import androidx.fragment.app.FragmentTransaction;
|
||||||
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
|
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.view.Menu;
|
import android.util.Log;
|
||||||
import android.view.MenuItem;
|
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.widget.Button;
|
import android.widget.Button;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
import android.widget.Toast;
|
import android.widget.ToggleButton;
|
||||||
|
|
||||||
import androidx.appcompat.app.AppCompatActivity;
|
import com.example.ueberwachungssystem.Fragments.Fragment1;
|
||||||
import java.net.InetAddress;
|
import com.example.ueberwachungssystem.Fragments.Fragment2;
|
||||||
import java.net.UnknownHostException;
|
|
||||||
import java.nio.ByteBuffer;
|
|
||||||
import java.nio.ByteOrder;
|
|
||||||
|
|
||||||
@SuppressLint("SetTextI18n")
|
@ExperimentalGetImage
|
||||||
public class MainActivity extends AppCompatActivity {
|
public class MainActivity extends AppCompatActivity implements View.OnClickListener {
|
||||||
TextView tvMessages;
|
//Fragmente
|
||||||
TextView tvConnectionInfos;
|
private Fragment aktuellesFragment;
|
||||||
|
private Fragment1 fragment1;
|
||||||
|
private Fragment2 fragment2;
|
||||||
|
|
||||||
|
//Textviews
|
||||||
|
private TextView Auswahl;
|
||||||
|
private TextView AoderA;
|
||||||
|
private String auswahltext = "Wahl des Detektionsmodus";
|
||||||
|
private String auswahlAoderA = "Wahl von Alarmmeldungen oder Auswahl von Alarmaufzeichnungen";
|
||||||
|
|
||||||
|
//Sensoren und Kommunikation
|
||||||
WifiCommunication communication;
|
WifiCommunication communication;
|
||||||
PermissionRequest permission;
|
//Buttons
|
||||||
public static String SERVER_IP = "";
|
private ToggleButton toggleKamera;
|
||||||
public static final int SERVER_PORT = 1234;
|
private ToggleButton toggleAudio;
|
||||||
//private static final int PERMISSION_REQUEST_CODE = 123;
|
private ToggleButton toggleBewegung;
|
||||||
float i=0;
|
|
||||||
|
|
||||||
boolean communicationRunning = false;
|
//Überprüfungswerte
|
||||||
|
boolean wahr;
|
||||||
|
private void log(String nachricht) {
|
||||||
|
Log.d(this.getClass().getSimpleName(), nachricht);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
|
setTitle(this.getClass().getSimpleName());
|
||||||
setContentView(R.layout.activity_main);
|
setContentView(R.layout.activity_main);
|
||||||
tvMessages = findViewById(R.id.tvMessages);
|
Auswahl = findViewById(R.id.textAuswahl);
|
||||||
tvConnectionInfos = findViewById(R.id.tvConnectionInfos);
|
Auswahl.setText(auswahltext);
|
||||||
try {
|
AoderA = findViewById(R.id.textAoderA);
|
||||||
SERVER_IP = getLocalIpAddress();
|
AoderA.setText(auswahlAoderA);
|
||||||
tvConnectionInfos.setText("Connection Infos: \n Own IP-Adress: " + SERVER_IP+ " Port: " + SERVER_PORT);
|
toggleKamera = findViewById(R.id.toggleKamera);
|
||||||
} catch (UnknownHostException e) {
|
toggleKamera.setOnClickListener(this);
|
||||||
e.printStackTrace();
|
toggleAudio = findViewById(R.id.toggleAudio);
|
||||||
}
|
toggleAudio.setOnClickListener(this);
|
||||||
Button btnSend = findViewById(R.id.btnSend);
|
toggleBewegung = findViewById(R.id.toggleBewegung);
|
||||||
btnSend.setOnClickListener(new View.OnClickListener() {
|
toggleBewegung.setOnClickListener(this);
|
||||||
@Override
|
|
||||||
public void onClick(View v) {
|
|
||||||
i++;
|
|
||||||
communication.sendTrue(String.valueOf(i));
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
public boolean onCreateOptionsMenu(Menu menu) {
|
|
||||||
getMenuInflater().inflate(R.menu.options_menu, menu);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
public boolean onOptionsItemSelected(MenuItem item) {
|
|
||||||
Toast.makeText(this, "Selected Item: " +item.getTitle(), Toast.LENGTH_SHORT).show();
|
|
||||||
PopUpClass popUpClass;
|
|
||||||
switch (item.getItemId()) {
|
|
||||||
case R.id.Rechteverwaltung:
|
|
||||||
popUpClass = new PopUpClass(MainActivity.this);
|
|
||||||
popUpClass.showPopupWindow(tvMessages);
|
|
||||||
popUpClass.RechtePrüfen();
|
|
||||||
return true;
|
|
||||||
case R.id.Sensoren:
|
|
||||||
popUpClass = new PopUpClass(MainActivity.this);
|
|
||||||
popUpClass.showPopupWindow(tvMessages);
|
|
||||||
popUpClass.Sensoren();
|
|
||||||
return true;
|
|
||||||
case R.id.Impressum:
|
|
||||||
popUpClass = new PopUpClass(MainActivity.this);
|
|
||||||
popUpClass.showPopupWindow(tvMessages);
|
|
||||||
popUpClass.Impressum();
|
|
||||||
return true;
|
|
||||||
default:
|
|
||||||
return super.onOptionsItemSelected(item);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
protected void onResume() {
|
}
|
||||||
super.onResume();
|
@Override
|
||||||
if (!communicationRunning){
|
public void onClick(View v) {
|
||||||
communication = new WifiCommunication(MainActivity.this, SERVER_PORT);
|
if (v == toggleKamera) {
|
||||||
communicationRunning = true;
|
if (toggleKamera.isChecked()) {
|
||||||
|
wahr = true;
|
||||||
|
} else {
|
||||||
|
wahr = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (v == toggleAudio) {
|
||||||
|
if (toggleAudio.isChecked()) {
|
||||||
|
wahr = true;
|
||||||
|
} else {
|
||||||
|
wahr = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (v == toggleBewegung) {
|
||||||
|
if (toggleBewegung.isChecked()) {
|
||||||
|
wahr = true;
|
||||||
|
} else {
|
||||||
|
wahr = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
permission = new PermissionRequest(MainActivity.this);
|
|
||||||
permission.rechtePruefen();
|
|
||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
protected void onPause() {
|
protected void onPause() {
|
||||||
super.onPause();
|
super.onPause();
|
||||||
communication.stopCommunication();
|
communication.stopCommunication();
|
||||||
}
|
}
|
||||||
private String getLocalIpAddress() throws UnknownHostException {
|
|
||||||
WifiManager wifiManager = (WifiManager) getApplicationContext().getSystemService(WIFI_SERVICE);
|
@Override
|
||||||
assert wifiManager != null;
|
protected void onResume() {
|
||||||
WifiInfo wifiInfo = wifiManager.getConnectionInfo();
|
super.onResume();
|
||||||
int ipInt = wifiInfo.getIpAddress();
|
communication = new WifiCommunication(1234);
|
||||||
return InetAddress.getByAddress(ByteBuffer.allocate(4).order(ByteOrder.LITTLE_ENDIAN).putInt(ipInt).array()).getHostAddress();
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
public void onClickZeigeFragment1(View view) {
|
||||||
|
Button button = (Button) view;
|
||||||
|
log(button.getText() + " ausgewählt");
|
||||||
|
zeigeFragment(fragment1.erstellen("Hier stehen dann die Alarme"));
|
||||||
|
}
|
||||||
|
|
||||||
|
public void onClickZeigeFragment2(View view) {
|
||||||
|
Button button = (Button) view;
|
||||||
|
log(button.getText() + " ausgewählt");
|
||||||
|
zeigeFragment(fragment2.erstellen("Hier stehen dann die Videos"));
|
||||||
|
}
|
||||||
|
|
||||||
|
public void onClickEntferneFragment(View view) {
|
||||||
|
entferneFragment();
|
||||||
|
}
|
||||||
|
private void zeigeFragment(Fragment fragment) {
|
||||||
|
FragmentTransaction ft = getSupportFragmentManager().beginTransaction();
|
||||||
|
ft.replace(R.id.frame, fragment);
|
||||||
|
ft.commit();
|
||||||
|
aktuellesFragment = fragment;
|
||||||
|
}
|
||||||
|
private void entferneFragment() {
|
||||||
|
if (aktuellesFragment != null) {
|
||||||
|
FragmentTransaction ft = getSupportFragmentManager().beginTransaction();
|
||||||
|
ft.remove(aktuellesFragment);
|
||||||
|
ft.commit();
|
||||||
|
aktuellesFragment = null ;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
package com.example.ueberwachungssystem;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import android.util.Log;
|
||||||
|
import android.view.View;
|
||||||
|
import android.view.ViewGroup;
|
||||||
|
import android.widget.ArrayAdapter;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class MeinAdapter extends ArrayAdapter<File> {
|
||||||
|
private Context context;
|
||||||
|
private File[] files;
|
||||||
|
public MeinAdapter(Context context, List<File> listf) {
|
||||||
|
super(context, android.R.layout.simple_list_item_1, listf);
|
||||||
|
this.context = context;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public View getView(final int pos, View cv, ViewGroup vg) {
|
||||||
|
View v = super.getView(pos, cv, vg);
|
||||||
|
v.setOnClickListener( new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
Log.d("DerLog","nicht null");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return v;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,43 @@
|
|||||||
|
package com.example.ueberwachungssystem;
|
||||||
|
|
||||||
|
|
||||||
|
import android.app.Activity;
|
||||||
|
import android.content.Context;
|
||||||
|
import android.content.pm.PackageManager;
|
||||||
|
import android.widget.Toast;
|
||||||
|
|
||||||
|
import androidx.core.app.ActivityCompat;
|
||||||
|
import androidx.core.content.ContextCompat;
|
||||||
|
|
||||||
|
public class PermissionHandler {
|
||||||
|
private final Context context;
|
||||||
|
private static final int PERMISSION_REQUEST_CODE = 23409;
|
||||||
|
private static final String[] permissions = new String[]{
|
||||||
|
android.Manifest.permission.CAMERA,
|
||||||
|
android.Manifest.permission.RECORD_AUDIO
|
||||||
|
};
|
||||||
|
|
||||||
|
public PermissionHandler(Context context) {
|
||||||
|
this.context = context;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean hasPermissions() {
|
||||||
|
boolean permissionState = true;
|
||||||
|
for (String permission: permissions) {
|
||||||
|
permissionState = permissionState && ContextCompat.checkSelfPermission(context, permission) == PackageManager.PERMISSION_GRANTED;
|
||||||
|
}
|
||||||
|
return permissionState;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void getPermissions() {
|
||||||
|
if (!hasPermissions())
|
||||||
|
ActivityCompat.requestPermissions((Activity) context, permissions, PERMISSION_REQUEST_CODE);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void showPermissionToast() {
|
||||||
|
if (hasPermissions())
|
||||||
|
Toast.makeText(context, "permissions available", Toast.LENGTH_SHORT).show();
|
||||||
|
else
|
||||||
|
Toast.makeText(context, "permissions missing", Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,36 @@
|
|||||||
|
package com.example.ueberwachungssystem;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import android.view.LayoutInflater;
|
||||||
|
import android.view.View;
|
||||||
|
import android.view.ViewGroup;
|
||||||
|
import android.widget.ArrayAdapter;
|
||||||
|
import android.widget.ImageView;
|
||||||
|
import android.widget.TextView;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class VideoListAdapter extends ArrayAdapter<File> {
|
||||||
|
|
||||||
|
public VideoListAdapter(Context context, List<File> videoList) {
|
||||||
|
super(context, 0, videoList);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public View getView(int position, View convertView, ViewGroup parent) {
|
||||||
|
if (convertView == null) {
|
||||||
|
convertView = LayoutInflater.from(getContext()).inflate(R.layout.list_item_video, parent, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
File videoFile = getItem(position);
|
||||||
|
|
||||||
|
ImageView thumbnailImageView = convertView.findViewById(R.id.imageViewThumbnail);
|
||||||
|
TextView titleTextView = convertView.findViewById(R.id.textViewTitle);
|
||||||
|
|
||||||
|
// Set tag to identify the clicked item
|
||||||
|
convertView.setTag(videoFile.getAbsolutePath());
|
||||||
|
|
||||||
|
return convertView;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
package com.example.ueberwachungssystem;
|
package com.example.ueberwachungssystem;
|
||||||
import android.annotation.SuppressLint;
|
import android.annotation.SuppressLint;
|
||||||
import android.widget.Toast;
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.net.DatagramPacket;
|
import java.net.DatagramPacket;
|
||||||
@@ -15,7 +16,7 @@ import java.util.Date;
|
|||||||
import java.util.Enumeration;
|
import java.util.Enumeration;
|
||||||
|
|
||||||
public class WifiCommunication {
|
public class WifiCommunication {
|
||||||
private final MainActivity mainActivity;
|
//private final MainActivity mainActivity;
|
||||||
private final InetAddress address;
|
private final InetAddress address;
|
||||||
private final int port;
|
private final int port;
|
||||||
|
|
||||||
@@ -23,9 +24,11 @@ public class WifiCommunication {
|
|||||||
volatile private boolean send;
|
volatile private boolean send;
|
||||||
private final DatagramSocket socket;
|
private final DatagramSocket socket;
|
||||||
volatile private boolean running;
|
volatile private boolean running;
|
||||||
|
|
||||||
|
private OnConnectionListener listener;
|
||||||
@SuppressLint("SetTextI18n")
|
@SuppressLint("SetTextI18n")
|
||||||
public WifiCommunication(MainActivity mainActivity, int port) {
|
public WifiCommunication(int port) {
|
||||||
this.mainActivity = mainActivity;
|
//this.mainActivity = mainActivity;
|
||||||
this.port = port;
|
this.port = port;
|
||||||
try {
|
try {
|
||||||
socket = new DatagramSocket(this.port);
|
socket = new DatagramSocket(this.port);
|
||||||
@@ -38,10 +41,23 @@ public class WifiCommunication {
|
|||||||
} catch (SocketException | UnknownHostException e) {
|
} catch (SocketException | UnknownHostException e) {
|
||||||
throw new RuntimeException(e);
|
throw new RuntimeException(e);
|
||||||
}
|
}
|
||||||
Toast.makeText(mainActivity.getApplicationContext(),"Communication running", Toast.LENGTH_SHORT).show();
|
//Toast.makeText(mainActivity.getApplicationContext(),"Communication running", Toast.LENGTH_SHORT).show();
|
||||||
|
|
||||||
//mainActivity.runOnUiThread(() -> mainActivity.tvMessages.setText("Communication running"));
|
//mainActivity.runOnUiThread(() -> mainActivity.tvMessages.setText("Communication running"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public interface OnConnectionListener {
|
||||||
|
void onConnection(StringBuffer data);
|
||||||
|
}
|
||||||
|
public void setOnConnectionListener(@NonNull OnConnectionListener listener) {
|
||||||
|
this.listener = listener;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void sendWifiData(StringBuffer wifiMessage) {
|
||||||
|
if (listener != null) {
|
||||||
|
listener.onConnection(wifiMessage);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private class ReceiveThread extends Thread {
|
private class ReceiveThread extends Thread {
|
||||||
private StringBuffer rxStringBuffer = new StringBuffer();
|
private StringBuffer rxStringBuffer = new StringBuffer();
|
||||||
private String rxString="";
|
private String rxString="";
|
||||||
@@ -54,11 +70,12 @@ public class WifiCommunication {
|
|||||||
byte[] receiveData = new byte[512];
|
byte[] receiveData = new byte[512];
|
||||||
DatagramPacket rxPacket = new DatagramPacket(receiveData, receiveData.length);
|
DatagramPacket rxPacket = new DatagramPacket(receiveData, receiveData.length);
|
||||||
socket.receive(rxPacket);
|
socket.receive(rxPacket);
|
||||||
rxString = new String(rxPacket.getData());
|
rxString = new String(receiveData, 0, rxPacket.getLength());
|
||||||
String[] splitrxString = rxString.split(",");
|
String[] splitrxString = rxString.split(",");
|
||||||
if(!previousRxString.equals(rxString) && splitrxString[0].equals("1") && splitrxString.length==7) {
|
if(!previousRxString.equals(rxString) && splitrxString[0].equals("1") && splitrxString.length==7) {
|
||||||
rxStringBuffer.append(rxString).append("\n");
|
rxStringBuffer.append(rxString).append("\n");
|
||||||
mainActivity.runOnUiThread(() -> mainActivity.tvMessages.setText(rxStringBuffer));
|
sendWifiData(rxStringBuffer);
|
||||||
|
//mainActivity.runOnUiThread(() -> mainActivity.tvMessages.setText(rxStringBuffer));
|
||||||
previousRxString = rxString;
|
previousRxString = rxString;
|
||||||
}
|
}
|
||||||
} while (running);
|
} while (running);
|
||||||
@@ -86,7 +103,7 @@ public class WifiCommunication {
|
|||||||
|
|
||||||
DatagramPacket txPacket = new DatagramPacket(send_Data, txString.length(), address, port);
|
DatagramPacket txPacket = new DatagramPacket(send_Data, txString.length(), address, port);
|
||||||
|
|
||||||
for(int i = 0; i < 500; i++) {
|
for(int i = 0; i < 300; i++) {
|
||||||
socket.send(txPacket);
|
socket.send(txPacket);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,5 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<item android:state_checked="false" android:drawable="@color/redbright" />
|
||||||
|
<item android:state_checked="true" android:drawable="@color/greenbright" />
|
||||||
|
</selector>
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
@@ -1,37 +1,129 @@
|
|||||||
<?xml version = "1.0" encoding = "utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<RelativeLayout xmlns:android = "http://schemas.android.com/apk/res/android"
|
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:tools = "http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:layout_width = "match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height = "match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_margin = "16dp"
|
android:background="#010C49"
|
||||||
tools:context = ".MainActivity">
|
android:visibility="visible"
|
||||||
<TextView
|
tools:context="com.example.ueberwachungssystem.MainActivity"
|
||||||
android:id = "@+id/tvConnectionInfos"
|
tools:visibility="visible">
|
||||||
android:layout_width = "match_parent"
|
|
||||||
android:layout_height = "wrap_content"
|
|
||||||
android:inputType = "textMultiLine"
|
|
||||||
android:hint="ConnectionInfos"
|
|
||||||
android:textAppearance = "@style/Base.TextAppearance.AppCompat.Medium" />
|
|
||||||
|
|
||||||
<Button
|
<TextView
|
||||||
android:id="@+id/btnSend"
|
android:id="@+id/textAuswahl"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_alignParentTop="true"
|
||||||
|
android:layout_alignParentLeft="true"
|
||||||
|
android:textSize="20sp"
|
||||||
|
android:textColor="@color/white"/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/textAoderA"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_below="@+id/toggleAudio"
|
||||||
|
android:layout_alignParentLeft="true"
|
||||||
|
android:layout_marginTop="15dp"
|
||||||
|
android:textSize="20sp"
|
||||||
|
android:textColor="@color/white"/>
|
||||||
|
|
||||||
|
<ToggleButton
|
||||||
|
android:id="@+id/toggleKamera"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_below="@id/scrollView"
|
android:layout_alignBottom="@id/toggleAudio"
|
||||||
android:layout_centerHorizontal="true"
|
android:layout_marginRight="30dp"
|
||||||
android:text="SEND" />
|
android:layout_toLeftOf="@id/toggleAudio"
|
||||||
|
android:textColor="@color/yellow"
|
||||||
|
android:textOn="Kamera an"
|
||||||
|
android:textOff="Kamera aus"
|
||||||
|
android:background="@drawable/toggle_btn"/>
|
||||||
|
|
||||||
<ScrollView
|
<ToggleButton
|
||||||
android:id="@+id/scrollView"
|
android:id="@+id/toggleAudio"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_below="@id/textAuswahl"
|
||||||
|
android:layout_centerHorizontal="true"
|
||||||
|
android:layout_marginTop="5dp"
|
||||||
|
android:textColor="@color/yellow"
|
||||||
|
android:textOn="Audio an"
|
||||||
|
android:textOff="Audio aus"
|
||||||
|
android:background="@drawable/toggle_btn"/>
|
||||||
|
|
||||||
|
<ToggleButton
|
||||||
|
android:id="@+id/toggleBewegung"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_alignBottom="@id/toggleAudio"
|
||||||
|
android:layout_marginLeft="30dp"
|
||||||
|
android:layout_toEndOf="@+id/toggleAudio"
|
||||||
|
android:layout_toRightOf="@id/toggleAudio"
|
||||||
|
android:textColor="@color/yellow"
|
||||||
|
android:textOn="Bewegung an"
|
||||||
|
android:textOff="Bewegung aus"
|
||||||
|
android:background="@drawable/toggle_btn"/>
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:id="@+id/btnAlarme"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_alignBottom="@+id/btnAufnahmen"
|
||||||
|
android:layout_toLeftOf="@id/btnAufnahmen"
|
||||||
|
android:layout_marginRight="15dp"
|
||||||
|
android:theme="@style/Button.Green"
|
||||||
|
android:onClick="onClickZeigeFragment1"
|
||||||
|
android:text="Alarme" />
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:id="@+id/btnAufnahmen"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_below="@+id/textAoderA"
|
||||||
|
android:layout_centerHorizontal="true"
|
||||||
|
android:layout_marginTop="15dp"
|
||||||
|
android:theme="@style/Button.Green"
|
||||||
|
android:onClick="onClickZeigeFragment2"
|
||||||
|
android:text="Aufnahmen" />
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:id="@+id/btnAnzeigeVerb"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_alignBottom="@+id/btnAufnahmen"
|
||||||
|
android:layout_toRightOf="@id/btnAufnahmen"
|
||||||
|
android:layout_marginLeft="15dp"
|
||||||
|
android:text="Anzeige verbergen"
|
||||||
|
android:onClick="onClickEntferneFragment"/>
|
||||||
|
|
||||||
|
<FrameLayout
|
||||||
|
android:id="@+id/frame"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_below="@id/tvConnectionInfos"
|
android:layout_height="match_parent"
|
||||||
android:layout_height="300dp">
|
android:layout_below="@+id/btnAufnahmen"
|
||||||
<TextView
|
android:layout_marginTop="25dp"
|
||||||
android:id = "@+id/tvMessages"
|
android:layout_alignParentStart="true"
|
||||||
android:layout_width = "match_parent"
|
android:background="@color/white">
|
||||||
android:layout_height = "wrap_content"
|
</FrameLayout>
|
||||||
android:hint="Messages"
|
|
||||||
android:inputType = "textMultiLine"
|
<!--
|
||||||
android:textAppearance = "@style/Base.TextAppearance.AppCompat.Medium" />
|
<ScrollView
|
||||||
|
android:id="@+id/scrollView1"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_below="@id/btnAufnahmen"
|
||||||
|
android:layout_marginTop="25dp">
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:orientation="vertical" >
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/Alarm"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:background="@color/red"/>
|
||||||
|
</LinearLayout>
|
||||||
</ScrollView>
|
</ScrollView>
|
||||||
|
-->
|
||||||
|
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:gravity="center_horizontal"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:background="@color/bluedark">
|
||||||
|
|
||||||
|
<ScrollView
|
||||||
|
android:id="@+id/scrollView1"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_marginTop="25dp">
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:orientation="vertical" >
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/Alarm"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:textColor="@color/yellow"/>
|
||||||
|
</LinearLayout>
|
||||||
|
</ScrollView>
|
||||||
|
|
||||||
|
</RelativeLayout>
|
||||||
@@ -0,0 +1,33 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:gravity="center_horizontal"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:background="@android:color/holo_blue_light" >
|
||||||
|
|
||||||
|
<ScrollView
|
||||||
|
android:id="@+id/scrollView2"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="250dp"
|
||||||
|
android:layout_marginTop="25dp">
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:orientation="vertical" >
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/Aufzeichnungen"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:textColor="@color/yellow"/>
|
||||||
|
</LinearLayout>
|
||||||
|
</ScrollView>
|
||||||
|
|
||||||
|
<VideoView
|
||||||
|
android:id="@+id/AusAuf"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_below="@id/scrollView2"
|
||||||
|
android:textAppearance="?android:attr/textAppearanceLarge"/>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:gravity="center_horizontal"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:background="@android:color/holo_blue_light" >
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/Sensor"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:textAppearance="?android:attr/textAppearanceLarge"/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/Alarm"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_below="@id/Sensor"
|
||||||
|
android:textAppearance="?android:attr/textAppearanceLarge"/>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
@@ -7,4 +7,9 @@
|
|||||||
<color name="teal_700">#FF018786</color>
|
<color name="teal_700">#FF018786</color>
|
||||||
<color name="black">#FF000000</color>
|
<color name="black">#FF000000</color>
|
||||||
<color name="white">#FFFFFFFF</color>
|
<color name="white">#FFFFFFFF</color>
|
||||||
|
<color name="red">#5C0000</color>
|
||||||
|
<color name="redbright">#EF3434</color>
|
||||||
|
<color name="greenbright">#469733</color>
|
||||||
|
<color name="bluedark">#053C8E</color>
|
||||||
|
<color name="yellow">#FFEB3B</color>
|
||||||
</resources>
|
</resources>
|
||||||
@@ -13,4 +13,9 @@
|
|||||||
<item name="android:statusBarColor">?attr/colorPrimaryVariant</item>
|
<item name="android:statusBarColor">?attr/colorPrimaryVariant</item>
|
||||||
<!-- Customize your theme here. -->
|
<!-- Customize your theme here. -->
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
<style name="Button.Green" parent="ThemeOverlay.AppCompat">
|
||||||
|
<item name="colorAccent">#0F3E01</item>
|
||||||
|
</style>
|
||||||
|
|
||||||
</resources>
|
</resources>
|
||||||
+2
-2
@@ -1,5 +1,5 @@
|
|||||||
// Top-level build file where you can add configuration options common to all sub-projects/modules.
|
// Top-level build file where you can add configuration options common to all sub-projects/modules.
|
||||||
plugins {
|
plugins {
|
||||||
id 'com.android.application' version '7.4.2' apply false
|
id 'com.android.application' version '8.0.0' apply false
|
||||||
id 'com.android.library' version '7.4.2' apply false
|
id 'com.android.library' version '8.0.0' apply false
|
||||||
}
|
}
|
||||||
+3
-1
@@ -18,4 +18,6 @@ android.useAndroidX=true
|
|||||||
# Enables namespacing of each library's R class so that its R class includes only the
|
# Enables namespacing of each library's R class so that its R class includes only the
|
||||||
# resources declared in the library itself and none from the library's dependencies,
|
# resources declared in the library itself and none from the library's dependencies,
|
||||||
# thereby reducing the size of the R class for that library
|
# thereby reducing the size of the R class for that library
|
||||||
android.nonTransitiveRClass=true
|
android.nonTransitiveRClass=true
|
||||||
|
android.defaults.buildfeatures.buildconfig=true
|
||||||
|
android.nonFinalResIds=false
|
||||||
+2
-2
@@ -1,6 +1,6 @@
|
|||||||
#Thu May 11 15:04:30 CEST 2023
|
#Thu May 11 15:19:24 CEST 2023
|
||||||
distributionBase=GRADLE_USER_HOME
|
distributionBase=GRADLE_USER_HOME
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip
|
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-bin.zip
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
zipStorePath=wrapper/dists
|
zipStorePath=wrapper/dists
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
|
|||||||
Reference in New Issue
Block a user