|
|
|
|
|
|
|
|
{
|
|
|
{
|
|
|
float distanceToEarthquake;
|
|
|
float distanceToEarthquake;
|
|
|
distanceToEarthquake = distance(currentLocation.getLatitude(), currentLocation.getLongitude(), Double.parseDouble(breitengradQuellVibration), Double.parseDouble(laengengradQuellVibration));
|
|
|
distanceToEarthquake = distance(currentLocation.getLatitude(), currentLocation.getLongitude(), Double.parseDouble(breitengradQuellVibration), Double.parseDouble(laengengradQuellVibration));
|
|
|
long wellenAusbreitungsGeschwindigkeit = 4500; //Meter die Sekunde
|
|
|
|
|
|
|
|
|
long wellenAusbreitungsGeschwindigkeit = 500; //Meter die Sekunde
|
|
|
long delayInSeconds = (long) distanceToEarthquake/wellenAusbreitungsGeschwindigkeit; //s
|
|
|
long delayInSeconds = (long) distanceToEarthquake/wellenAusbreitungsGeschwindigkeit; //s
|
|
|
long delayInMilliSeconds = delayInSeconds*1000;
|
|
|
long delayInMilliSeconds = delayInSeconds*1000;
|
|
|
setVibrationTimer(delayInMilliSeconds,1500,255,f);
|
|
|
setVibrationTimer(delayInMilliSeconds,1500,255,f);
|
|
|
|
|
|
|
|
|
{
|
|
|
{
|
|
|
float distanceToEarthquake;
|
|
|
float distanceToEarthquake;
|
|
|
distanceToEarthquake = distance(currentLocation.getLatitude(), currentLocation.getLongitude(), Double.parseDouble(breitengradQuellVibration), Double.parseDouble(laengengradQuellVibration));
|
|
|
distanceToEarthquake = distance(currentLocation.getLatitude(), currentLocation.getLongitude(), Double.parseDouble(breitengradQuellVibration), Double.parseDouble(laengengradQuellVibration));
|
|
|
long wellenAusbreitungsGeschwindigkeit = 4500; //Meter die Sekunde
|
|
|
|
|
|
|
|
|
long wellenAusbreitungsGeschwindigkeit = 500; //Meter die Sekunde
|
|
|
long delayInSeconds = (long) distanceToEarthquake/wellenAusbreitungsGeschwindigkeit; //s
|
|
|
long delayInSeconds = (long) distanceToEarthquake/wellenAusbreitungsGeschwindigkeit; //s
|
|
|
long delayInMilliSeconds = delayInSeconds*1000;
|
|
|
long delayInMilliSeconds = delayInSeconds*1000;
|
|
|
setVibrationTimer(delayInMilliSeconds,1500,255,f);
|
|
|
setVibrationTimer(delayInMilliSeconds,1500,255,f);
|
|
|
|
|
|
|
|
|
{
|
|
|
{
|
|
|
mDatenbank = FirebaseDatabase.getInstance().getReference();
|
|
|
mDatenbank = FirebaseDatabase.getInstance().getReference();
|
|
|
mDatenbank.child("overviewnodes").child("IDG" + k).child("a_androidid").setValue(getandroidid());
|
|
|
mDatenbank.child("overviewnodes").child("IDG" + k).child("a_androidid").setValue(getandroidid());
|
|
|
/*
|
|
|
|
|
|
|
|
|
|
|
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
|
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
|
|
mDatenbank.child("overviewnodes").child("IDG" + k).child("b_localdatetime").setValue(LocalDateTime.now().toString());
|
|
|
|
|
|
|
|
|
//mDatenbank.child("overviewnodes").child("IDG" + k).child("b_localdatetime").setValue(LocalDateTime.now().toString());
|
|
|
|
|
|
mDatenbank.child("overviewnodes").child("IDG" + k).child("b_localdatetime").setValue(LocalDateTime.now(ZoneOffset.UTC).toString());
|
|
|
|
|
|
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
mDatenbank.child("overviewnodes").child("IDG" + k).child("b_localdatetime").setValue(LocalDateTime.now(ZoneOffset.UTC).toString());
|
|
|
|
|
|
mDatenbank.child("overviewnodes").child("IDG" + k).child("c_ip").setValue(getDeviceIpAdress());
|
|
|
mDatenbank.child("overviewnodes").child("IDG" + k).child("c_ip").setValue(getDeviceIpAdress());
|
|
|
if (useOwnGPS)
|
|
|
if (useOwnGPS)
|
|
|
{
|
|
|
{
|