|
|
|
|
|
|
|
|
|
|
|
|
|
|
// In constructor pass Activity, Context and TextView from MainActivity in Accelerometer class |
|
|
// In constructor pass Activity, Context and TextView from MainActivity in Accelerometer class |
|
|
public Accelerometer(Context context){ |
|
|
public Accelerometer(Context context){ |
|
|
super(context); //von Detektor |
|
|
|
|
|
|
|
|
super(); //von Detektor |
|
|
this.context = context; |
|
|
this.context = context; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!alarm) { |
|
|
if (!alarm) { |
|
|
if (betrag > threshold) { |
|
|
if (betrag > threshold) { |
|
|
alarm = true; |
|
|
alarm = true; |
|
|
detectionReport = new DetectionReport("Accelerometer1", "Bewegung", betrag); |
|
|
|
|
|
reportViolation("Accelo1", "Bewegung", betrag); |
|
|
|
|
|
|
|
|
reportViolation("Bewegung", betrag); |
|
|
} |
|
|
} |
|
|
} else { |
|
|
} else { |
|
|
if (betrag < threshold) { |
|
|
if (betrag < threshold) { |