Pre-AlphaV4
This commit is contained in:
parent
022ecd94a6
commit
59880392f6
@ -65,7 +65,7 @@ public class MainActivity extends AppCompatActivity {
|
||||
private int indexID = 1;
|
||||
private int writtenDevices = 1;
|
||||
private boolean allowCalculation = true;
|
||||
|
||||
private boolean enableDisplayReset = true;
|
||||
//##########################################################################################################################################################################
|
||||
//################################################################## vvv SensorParameter vvv ##############################################################################
|
||||
private SensorManager mSensorManager;
|
||||
@ -78,6 +78,7 @@ public class MainActivity extends AppCompatActivity {
|
||||
private boolean mShakeDetectionIsActive = false;
|
||||
private boolean mShakeDetected = false;
|
||||
private boolean allowShakeEvent = true;
|
||||
|
||||
//################################################################## ^^^^ SensorParameter ^^^^ ############################################################################
|
||||
//##########################################################################################################################################################################
|
||||
|
||||
@ -289,15 +290,6 @@ public class MainActivity extends AppCompatActivity {
|
||||
mDatenbank.child("IDG" + k).child("e_laengengrad").setValue("");
|
||||
mDatenbank.child("IDG" + k).child("h_timestamp").setValue("");
|
||||
mDatenbank.child("IDG" + k).child("i_amplitude").setValue("");
|
||||
|
||||
/*
|
||||
k=1;
|
||||
mDatenbank.child("IDG" + k).child("a_androidid").setValue(getandroidid());
|
||||
mDatenbank.child("IDG" + k).child("b_localdatetime").setValue(LocalDateTime.now(ZoneOffset.UTC).toString());
|
||||
mDatenbank.child("IDG" + k).child("d_breitengrad").setValue(123);
|
||||
mDatenbank.child("IDG" + k).child("e_laengengrad").setValue(456);
|
||||
mDatenbank.child("IDG" + k).child("h_timestamp").setValue(Calendar.getInstance().getTimeInMillis());
|
||||
*/
|
||||
}
|
||||
|
||||
//###### Bei Vibration der APP ####
|
||||
@ -320,10 +312,8 @@ public class MainActivity extends AppCompatActivity {
|
||||
{
|
||||
for (int i=1; i<=data.getChildrenCount(); i++)
|
||||
{
|
||||
System.out.println("Schaue ob in DB IDG leer ist bei: " + i );
|
||||
if(analyzeForEmptyIDG(data,i))
|
||||
{
|
||||
System.out.println("Schreibe in DB mit IDG " + i );
|
||||
writeDeviceToDB(i);
|
||||
break;
|
||||
}
|
||||
@ -384,7 +374,6 @@ public class MainActivity extends AppCompatActivity {
|
||||
|
||||
public void analyzeDBchanges(DataSnapshot data)
|
||||
{
|
||||
System.out.println("########################Höre auf Veränderungen....");
|
||||
int takenIDG = 0;
|
||||
for (int i=1; i<=data.getChildrenCount(); i++)
|
||||
{
|
||||
@ -399,6 +388,14 @@ public class MainActivity extends AppCompatActivity {
|
||||
for(writtenDevices = writtenDevices; writtenDevices <= takenIDG; writtenDevices++)
|
||||
{
|
||||
setDisplayText(data,writtenDevices);
|
||||
enableDisplayReset = true; //Für DB zurücksetzen
|
||||
}
|
||||
}else
|
||||
{
|
||||
if(enableDisplayReset)
|
||||
{
|
||||
resetDisplayText();
|
||||
enableDisplayReset = false;
|
||||
}
|
||||
}
|
||||
//TODO @Aron hier Jans Code anschließen
|
||||
@ -461,6 +458,17 @@ public class MainActivity extends AppCompatActivity {
|
||||
}
|
||||
}
|
||||
|
||||
public void resetDisplayText()
|
||||
{
|
||||
TextView txtDevice1 = (TextView) findViewById(R.id.txtdevice1);
|
||||
TextView txtDevice2 = (TextView) findViewById(R.id.txtdevice2);
|
||||
TextView txtDevice3 = (TextView) findViewById(R.id.txtdevice3);
|
||||
TextView txtDevice4 = (TextView) findViewById(R.id.txtdevice4);
|
||||
txtDevice1.setText("");
|
||||
txtDevice2.setText("");
|
||||
txtDevice3.setText("");
|
||||
txtDevice4.setText("");
|
||||
}
|
||||
public String getandroidid ()
|
||||
{
|
||||
return Settings.Secure.getString(this.getContentResolver(), Settings.Secure.ANDROID_ID);
|
||||
|
Loading…
x
Reference in New Issue
Block a user