Compare commits

..
16 Commits
Author SHA1 Message Date
Leon Market 81c3542654 Removed unnecessary packages 2023-06-20 21:13:08 +02:00
Leon Market d33ab299ab Added reportViolation() 2023-06-20 20:59:18 +02:00
Leon Market 8a5d720685 Changed to a (hopefully) working version of the Accelerometer 2023-06-18 13:13:30 +02:00
Leon Market 90aea5b1bc Added LinkedBlockingQueue to collect data, added Thread to evaluate data from queue 2023-06-17 23:58:34 +02:00
Leon Market 8a357e0d26 Fixed errors after merge with origin:lm 2023-06-17 19:20:32 +02:00
Leon Market 83268c763b Merge remote-tracking branch 'origin/lm' into lm
# Conflicts:
#	app/src/main/java/com/example/ueberwachungssystem/Beschleunigungssensor.java
2023-06-17 19:17:11 +02:00
Leon Market 3d02d8d4c0 Added 2023-06-17 19:16:48 +02:00
Leon Market cafe763c4a Removed unnecessary code parts 2023-06-17 19:14:34 +02:00
Leon Market 2cff334056 Added detection report 2023-06-17 19:00:44 +02:00
Leon Market 6c4905d0e7 Added constructors for activity and textView in ThreadDemo 2023-06-15 14:27:25 +02:00
Leon Market 402b73e4bd Removed calibration code and added method checkAlarm 2023-06-14 22:28:05 +02:00
Leon Market 9e5b669986 Added Accelerometer as Runnable Class and ThreadDemo as example 2023-06-14 22:25:54 +02:00
Leon Market 8275d8bd5a Added 2023-06-14 22:11:17 +02:00
Leon Market 4999f1b998 added Detector, DetectorReport, Logger 2023-05-25 16:46:12 +02:00
Leon Market 620528302e added Beschleunigungssensor 2023-05-24 20:40:18 +02:00
kohlerba68671 065acefeb9 Merge branch 'ms' of siebenhaarmi76624/MDT5_1_Ueberwachungssystem_G1 into master 2023-05-11 13:29:40 +00:00
18 changed files with 298 additions and 423 deletions
View File
+3
View File
@@ -0,0 +1,3 @@
Sensor als Service einrichten, der aus Activity heraus gestartet werden kann.
Stichwort: Intent
Siehe Skript Teil 1
-4
View File
@@ -26,9 +26,6 @@ android {
sourceCompatibility JavaVersion.VERSION_1_8 sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8
} }
buildFeatures {
viewBinding true
}
} }
dependencies { dependencies {
@@ -36,7 +33,6 @@ dependencies {
implementation 'androidx.appcompat:appcompat:1.6.1' implementation 'androidx.appcompat:appcompat:1.6.1'
implementation 'com.google.android.material:material:1.8.0' implementation 'com.google.android.material:material:1.8.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4' implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
implementation 'com.google.android.gms:play-services-nearby:18.0.0'
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'
+1 -9
View File
@@ -2,26 +2,18 @@
<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-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<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"
android:dataExtractionRules="@xml/data_extraction_rules" android:dataExtractionRules="@xml/data_extraction_rules"
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" />
@@ -0,0 +1,109 @@
package com.example.ueberwachungssystem.Detection;
import static java.lang.Math.sqrt;
import android.content.Context;
import android.hardware.Sensor;
import android.hardware.SensorEvent;
import android.hardware.SensorEventListener;
import android.hardware.SensorManager;
/**
* Accelerometer inherits some methods from abstract Detector class (more info there)
*
*
* USE FROM MAIN ACTIVITY:
*
* Accelerometer beschleunigungssensor = new Accelerometer(this);
* onCreate:
* //Accelerometer Setup
* beschleunigungssensor = new Accelerometer(this, logger, textViewLog); //logger and textview only for debugging necessary
* beschleunigungssensor.getSensor();
*
* //Starting Detection:
* beschleunigungssensor.startDetection();
* //Stopping Detection: also recommended at onPause to avoid unnecessary battery consumption
* beschleunigungssensor.stopDetection();
*
* */
public class Accelerometer extends Detector implements SensorEventListener {
public SensorManager sensorManager;
private static final int sensorType = Sensor.TYPE_LINEAR_ACCELERATION;
private Sensor accelerometer;
private Context context;
boolean alarm = false;
//Preallocate memory for the data of each axis of the acceleration sensor
float x;
float y;
float z;
float betrag; //Betrag aller drei Achsen sqrt(x*x + y*y + z*z)
private DetectionReport detectionReport;
// In constructor pass Activity, Context and TextView from MainActivity in Accelerometer class
public Accelerometer(Context context){
super(context); //von Detektor
this.context = context;
}
public void getSensor(){
sensorManager = (SensorManager)context.getSystemService(Context.SENSOR_SERVICE);
if(sensorManager.getSensorList(sensorType).size()==0) {
accelerometer = null;
}
else {
accelerometer = sensorManager.getSensorList(sensorType).get(0);
}
}
@Override
public void onSensorChanged(SensorEvent event) {
try {
checkAlarm(event);
} catch (InterruptedException e) {
throw new RuntimeException(e);
}
}
public void checkAlarm (SensorEvent event) throws InterruptedException {
x = event.values[0];
y = event.values[1];
z = event.values[2];
betrag = (float) sqrt(x*x + y*y + z*z);
float threshold = 1.5F;
if (!alarm) {
if (betrag > threshold) {
alarm = true;
detectionReport = new DetectionReport("Accelerometer1", "Bewegung", betrag);
reportViolation("Accelo1", "Bewegung", betrag);
}
} else {
if (betrag < threshold) {
alarm = false;
} else {
}
}
}
@Override
public void onAccuracyChanged(Sensor sensor, int accuracy) {
}
@Override
public void startDetection() {
// entspricht void start()
//getSensor();
if (accelerometer != null) {
sensorManager.registerListener(this, accelerometer, SensorManager.SENSOR_DELAY_GAME);
}
}
@Override
public void stopDetection() {
// entspricht void stop()
sensorManager.unregisterListener(this, accelerometer);
}
}
@@ -0,0 +1,36 @@
package com.example.ueberwachungssystem.Detection;
import android.util.Log;
import java.util.Calendar;
/** Detection Report Class */
public class DetectionReport {
public String timeStamp;
public String detectionType;
public float detectedValue;
public String detectorID;
public DetectionReport(String detectorID, String detectionType, float detectedAmplitude) {
this.timeStamp = String.valueOf(Calendar.getInstance().getTime());
this.detectionType = detectionType;
this.detectedValue = detectedAmplitude;
this.detectorID = detectorID;
}
/** Get Detection Report in String format */
public String toString() {
String time = "Time: " + "[" + this.timeStamp + "]";
String type = "Type: " + "[" + this.detectionType + "]";
String value = "Value: " + "[" + this.detectedValue + "]";
String id = "ID: " + "[" + this.detectorID + "]";
return String.join("\t", time, type, value, id);
}
/** Debug Report */
public void log(String tag) {
Log.d(tag, this.toString());
}
}
@@ -0,0 +1,39 @@
package com.example.ueberwachungssystem.Detection;
import android.content.Context;
import androidx.annotation.NonNull;
abstract public class Detector {
private OnDetectionListener listener;
/** Constructor - takes context of current activity */
public Detector(Context context) {};
/** On Detection Listener - runs when violation is reported */
public interface OnDetectionListener {
void onDetection(@NonNull DetectionReport detectionReport);
}
public void setOnDetectionListener(@NonNull OnDetectionListener listener) {
this.listener = listener;
}
/** Triggers onDetectionListener - call this to trigger violation/alarm */
public void reportViolation(String detectorID, String detectionType, float amplitude) {
if (listener != null) {
DetectionReport detectionReport = new DetectionReport(detectorID, detectionType, amplitude);
listener.onDetection(detectionReport);
} else {
throw new IllegalStateException("No listener set for violation reporting");
}
}
/** Starts Detection (abstract method: needs to be overridden in child class) */
public abstract void startDetection();
/** Stops Detection (abstract method: needs to be overridden in child class) */
public abstract void stopDetection();
}
@@ -1,103 +1,72 @@
package com.example.ueberwachungssystem; package com.example.ueberwachungssystem;
import android.annotation.SuppressLint; import androidx.annotation.NonNull;
import android.net.wifi.WifiInfo; import androidx.appcompat.app.AppCompatActivity;
import android.net.wifi.WifiManager;
import android.os.Bundle; import android.os.Bundle;
import android.view.Menu; import android.text.method.ScrollingMovementMethod;
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.Detection.Accelerometer;
import java.net.InetAddress; import com.example.ueberwachungssystem.Detection.DetectionReport;
import java.net.UnknownHostException; import com.example.ueberwachungssystem.Detection.Detector;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
@SuppressLint("SetTextI18n") public class MainActivity extends AppCompatActivity implements View.OnClickListener {
public class MainActivity extends AppCompatActivity {
TextView tvMessages;
TextView tvConnectionInfos;
WifiCommunication communication;
PermissionRequest permission;
public static String SERVER_IP = "";
public static final int SERVER_PORT = 1234;
//private static final int PERMISSION_REQUEST_CODE = 123;
float i=0;
boolean communicationRunning = false; private Accelerometer beschleunigungssensor;
private TextView textViewLog;
private Button button1;
ToggleButton toggleButton1;
@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);
tvConnectionInfos = findViewById(R.id.tvConnectionInfos);
try { toggleButton1 = findViewById(R.id.toggleButton1); //togglebutton um Detektion zu steuern
SERVER_IP = getLocalIpAddress(); toggleButton1.setOnClickListener(this);
tvConnectionInfos.setText("Connection Infos: \n Own IP-Adress: " + SERVER_IP+ " Port: " + SERVER_PORT);
} catch (UnknownHostException e) { //Button to clear Log while Debugging
e.printStackTrace(); button1 = (Button) findViewById(R.id.button1);
} button1.setOnClickListener(this);
Button btnSend = findViewById(R.id.btnSend);
btnSend.setOnClickListener(new View.OnClickListener() { //Accelerometer Setup
beschleunigungssensor = new Accelerometer(this); //logger and textview only for debugging necessary
beschleunigungssensor.getSensor();
beschleunigungssensor.setOnDetectionListener(new Detector.OnDetectionListener() {
@Override @Override
public void onClick(View v) { public void onDetection(@NonNull DetectionReport detectionReport) {
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);
}
} }
@Override
protected void onResume() { protected void onResume() {
super.onResume(); super.onResume();
if (!communicationRunning){
communication = new WifiCommunication(MainActivity.this, SERVER_PORT);
communicationRunning = true;
}
permission = new PermissionRequest(MainActivity.this);
permission.rechtePruefen();
} }
@Override @Override
protected void onPause() { protected void onPause() {
super.onPause(); super.onPause();
communication.stopCommunication(); beschleunigungssensor.stopDetection();
} }
private String getLocalIpAddress() throws UnknownHostException {
WifiManager wifiManager = (WifiManager) getApplicationContext().getSystemService(WIFI_SERVICE); @Override
assert wifiManager != null; public void onClick(View v) {
WifiInfo wifiInfo = wifiManager.getConnectionInfo(); if(v == toggleButton1) {
int ipInt = wifiInfo.getIpAddress(); if (toggleButton1.isChecked()) {
return InetAddress.getByAddress(ByteBuffer.allocate(4).order(ByteOrder.LITTLE_ENDIAN).putInt(ipInt).array()).getHostAddress(); beschleunigungssensor.startDetection();
} else {
beschleunigungssensor.stopDetection();
}
} else if (v == button1) {
}
} }
} }
@@ -1,48 +0,0 @@
package com.example.ueberwachungssystem;
import static android.Manifest.permission.INTERNET;
import static android.Manifest.permission.CAMERA;
import static android.Manifest.permission.RECORD_AUDIO;
import android.content.pm.PackageManager;
import android.os.Handler;
import android.widget.Toast;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.content.ContextCompat;
public class PermissionRequest extends AppCompatActivity{
private static final int PERMISSION_REQUEST_CODE = 123;
private final MainActivity mainActivity;
Handler handler = new Handler();
public PermissionRequest(MainActivity mainActivity) {
this.mainActivity = mainActivity;
}
public StringBuilder rechtePruefen() {
boolean rechtKamera = ContextCompat.checkSelfPermission(mainActivity, CAMERA) == PackageManager.PERMISSION_GRANTED;
boolean rechtMikrofon = ContextCompat.checkSelfPermission(mainActivity, RECORD_AUDIO) == PackageManager.PERMISSION_GRANTED;
boolean rechtInternet = ContextCompat.checkSelfPermission(mainActivity, INTERNET) == PackageManager.PERMISSION_GRANTED;
StringBuilder sb = new StringBuilder();
sb.append("Rechte prüfen:")
.append("\nKamera: ").append(rechtKamera)
.append("\nMikrofon: ").append(rechtMikrofon)
.append("\nInternet: ").append(rechtInternet);
//mainActivity.runOnUiThread(() -> mainActivity.tvMessages.setText(sb));
if (!(rechtKamera && rechtMikrofon && rechtInternet)){
handler.post(new Runnable() {
@Override
public void run() {
Toast.makeText(mainActivity.getApplicationContext(),"Es werden Rechte benötigt", Toast.LENGTH_LONG).show();
}
});
}
return sb;
}
public void rechteAnfordern() {
mainActivity.requestPermissions(new String[]{CAMERA, RECORD_AUDIO, INTERNET}, PERMISSION_REQUEST_CODE);
}
}
@@ -1,86 +0,0 @@
package com.example.ueberwachungssystem;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.MotionEvent;
import android.view.View;
import android.widget.Button;
import android.widget.LinearLayout;
import android.widget.PopupWindow;
import android.widget.TextView;
public class PopUpClass {
private final MainActivity mainActivity;
PermissionRequest permission;
TextView PopUpText;
public PopUpClass(MainActivity mainActivity) {
this.mainActivity = mainActivity;
permission = new PermissionRequest(mainActivity);
}
//PopupWindow display method
public void showPopupWindow(final View view) {
//Create a View object yourself through inflater
LayoutInflater inflater = (LayoutInflater) view.getContext().getSystemService(view.getContext().LAYOUT_INFLATER_SERVICE);
View popupView = inflater.inflate(R.layout.popup_window, null);
//Specify the length and width through constants
int width = LinearLayout.LayoutParams.WRAP_CONTENT;
int height = LinearLayout.LayoutParams.WRAP_CONTENT;
//Make Inactive Items Outside Of PopupWindow
boolean focusable = true;
//Create a window with our parameters
final PopupWindow popupWindow = new PopupWindow(popupView,width*1, height*1, focusable);
//Set the location of the window on the screen
popupWindow.showAtLocation(view, Gravity.CENTER, 0, 0);
//Initialize the elements of our window, install the handler
PopUpText = popupView.findViewById(R.id.titleText);
Button buttonEdit = popupView.findViewById(R.id.RechteAnfordern);
buttonEdit.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
RechteAnfordern();
}
});
//Handler for clicking on the inactive zone of the window
popupView.setOnTouchListener(new View.OnTouchListener() {
@Override
public boolean onTouch(View v, MotionEvent event) {
//Close the window when clicked
popupWindow.dismiss();
return true;
}
});
}
public void RechtePrüfen(){
StringBuilder Text = permission.rechtePruefen();
PopUpText.setText(Text);
}
public void RechteAnfordern(){
permission.rechteAnfordern();
StringBuilder Text = permission.rechtePruefen();
PopUpText.setText(Text);
}
public void Sensoren(){
PopUpText.setText("Es können 3 verschiedene Sensoren verwendet werden \n -1. Beschleunigungssensor\n -2. Mikrofon\n -3. Kamera");
}
public void Impressum(){
PopUpText.setText("Die Ueberwachungsapp wurde im Rahmen eines Praktikums der TH-Nürnberg programmiert");
}
}
@@ -1,124 +0,0 @@
package com.example.ueberwachungssystem;
import android.annotation.SuppressLint;
import android.widget.Toast;
import java.io.IOException;
import java.net.DatagramPacket;
import java.net.DatagramSocket;
import java.net.Inet4Address;
import java.net.InetAddress;
import java.net.NetworkInterface;
import java.net.SocketException;
import java.net.UnknownHostException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Enumeration;
public class WifiCommunication {
private final MainActivity mainActivity;
private final InetAddress address;
private final int port;
private String messageToSend;
volatile private boolean send;
private final DatagramSocket socket;
volatile private boolean running;
@SuppressLint("SetTextI18n")
public WifiCommunication(MainActivity mainActivity, int port) {
this.mainActivity = mainActivity;
this.port = port;
try {
socket = new DatagramSocket(this.port);
socket.setBroadcast(true);
address = InetAddress.getByName("255.255.255.255"); //100.82.255.255
running = true;
send = false;
new ReceiveThread().start();
new SendThread().start();
} catch (SocketException | UnknownHostException e) {
throw new RuntimeException(e);
}
Toast.makeText(mainActivity.getApplicationContext(),"Communication running", Toast.LENGTH_SHORT).show();
//mainActivity.runOnUiThread(() -> mainActivity.tvMessages.setText("Communication running"));
}
private class ReceiveThread extends Thread {
private StringBuffer rxStringBuffer = new StringBuffer();
private String rxString="";
private String previousRxString = "";
@Override
public void run() {
try {
do {
byte[] receiveData = new byte[512];
DatagramPacket rxPacket = new DatagramPacket(receiveData, receiveData.length);
socket.receive(rxPacket);
rxString = new String(rxPacket.getData());
String[] splitrxString = rxString.split(",");
if(!previousRxString.equals(rxString) && splitrxString[0].equals("1") && splitrxString.length==7) {
rxStringBuffer.append(rxString).append("\n");
mainActivity.runOnUiThread(() -> mainActivity.tvMessages.setText(rxStringBuffer));
previousRxString = rxString;
}
} while (running);
}
catch (IOException e) {
e.printStackTrace();
}
}
}
private class SendThread extends Thread {
private int tmpCnt = 0;
@Override
public void run() {
try {
do {
if(send)
{
send = false;
SimpleDateFormat formatter = new SimpleDateFormat("HH:mm:ss");
Date curDate = new Date(System.currentTimeMillis());
String str = formatter.format(curDate);
byte[] send_Data = new byte[512];
String txString = ("1," +str+ ",Gruppe2," + getLocalIpAddress() + ",An,Video," +messageToSend);
send_Data = txString.getBytes();
DatagramPacket txPacket = new DatagramPacket(send_Data, txString.length(), address, port);
for(int i = 0; i < 500; i++) {
socket.send(txPacket);
}
}
} while (running);
} catch (IOException e) {
e.printStackTrace();
}
}
}
public static String getLocalIpAddress() {
try {
for (Enumeration<NetworkInterface> en = NetworkInterface.getNetworkInterfaces(); en.hasMoreElements();) {
NetworkInterface networkInterface = (NetworkInterface) ((Enumeration<?>) en).nextElement();
for (Enumeration<InetAddress> addresses = networkInterface.getInetAddresses(); addresses.hasMoreElements();) {
InetAddress inetAddress = addresses.nextElement();
if (!inetAddress.isLoopbackAddress() && inetAddress instanceof Inet4Address) {
return inetAddress.getHostAddress();
}
}
}
} catch (SocketException ex) {
ex.printStackTrace();
}
return null;
}
public void sendTrue(String message){
send = true;
messageToSend = message;
}
public void stopCommunication() {
running = false;
socket.close();
}
}
+59 -33
View File
@@ -1,37 +1,63 @@
<?xml version = "1.0" encoding = "utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android = "http://schemas.android.com/apk/res/android" <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools = "http://schemas.android.com/tools" xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width = "match_parent" xmlns:tools="http://schemas.android.com/tools"
android:layout_height = "match_parent" android:layout_width="match_parent"
android:layout_margin = "16dp" android:layout_height="match_parent"
tools:context = ".MainActivity"> tools:context=".MainActivity">
<TextView
android:id = "@+id/tvConnectionInfos"
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/textViewLog"
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_marginStart="32dp"
android:layout_centerHorizontal="true" android:layout_marginTop="60dp"
android:text="SEND" /> android:layout_marginEnd="32dp"
android:maxLines="25"
android:scrollbars="vertical"
android:text="TextViewLoggerMain"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/textViewWorkerThread"
app:layout_constraintVertical_bias="0.0" />
<ScrollView <ToggleButton
android:id="@+id/scrollView" android:id="@+id/toggleButton1"
android:layout_width="match_parent" android:layout_width="wrap_content"
android:layout_below="@id/tvConnectionInfos" android:layout_height="wrap_content"
android:layout_height="300dp"> android:layout_marginStart="161dp"
<TextView android:layout_marginTop="115dp"
android:id = "@+id/tvMessages" android:layout_marginEnd="162dp"
android:layout_width = "match_parent" android:text="ToggleButton"
android:layout_height = "wrap_content" app:layout_constraintEnd_toEndOf="parent"
android:hint="Messages" app:layout_constraintStart_toStartOf="parent"
android:inputType = "textMultiLine" app:layout_constraintTop_toTopOf="parent" />
android:textAppearance = "@style/Base.TextAppearance.AppCompat.Medium" />
</ScrollView> <TextView
</RelativeLayout> android:id="@+id/textViewWorkerThread"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="32dp"
android:layout_marginTop="16dp"
android:layout_marginEnd="32dp"
android:text="textViewWorkerThreadTextView"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/toggleButton1" />
<Button
android:id="@+id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="35dp"
android:layout_marginTop="31dp"
android:layout_marginEnd="282dp"
android:layout_marginBottom="100dp"
android:text="Clear Log"
app:layout_constraintBottom_toTopOf="@+id/textViewWorkerThread"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
-29
View File
@@ -1,29 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="10dp"
android:paddingRight="10dp"
android:gravity="center"
android:background="#A5ACB2">
<TextView
android:id="@+id/titleText"
android:layout_gravity="center"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="20sp"
android:textStyle="italic"
android:padding="10dp"/>
<Button
android:id="@+id/RechteAnfordern"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Rechte Anfordern" />
</LinearLayout>
-9
View File
@@ -1,9 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android" >
<item android:id="@+id/Rechteverwaltung"
android:title="Rechteverwaltung" />
<item android:id="@+id/Sensoren"
android:title="Sensoren" />
<item android:id="@+id/Impressum"
android:title="Impressum" />
</menu>
+2 -2
View File
@@ -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
View File
@@ -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
+1 -1
View File
@@ -1,6 +1,6 @@
#Thu May 11 15:04:30 CEST 2023 #Thu May 11 15:04:30 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
-1
View File
@@ -14,4 +14,3 @@ dependencyResolutionManagement {
} }
rootProject.name = "Ueberwachungssystem" rootProject.name = "Ueberwachungssystem"
include ':app' include ':app'
include ':app'