diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index 4202ef2..a3f98e9 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -3,7 +3,7 @@
xmlns:tools="http://schemas.android.com/tools"
package="uk.org.openseizuredetector"
android:versionCode="92"
- android:versionName="4.0.0b">
+ android:versionName="4.0.0c">
@@ -37,7 +37,7 @@
android:label="@string/app_name"
android:networkSecurityConfig="@xml/network_security_config"
android:theme="@style/AppTheme">
-
+
diff --git a/app/src/main/java/uk/org/openseizuredetector/MainActivity.java b/app/src/main/java/uk/org/openseizuredetector/MainActivity.java
index dc00663..5ac2ac8 100644
--- a/app/src/main/java/uk/org/openseizuredetector/MainActivity.java
+++ b/app/src/main/java/uk/org/openseizuredetector/MainActivity.java
@@ -568,6 +568,42 @@ public class MainActivity extends AppCompatActivity {
tv.setBackgroundColor(okColour);
tv.setTextColor(okTextColour);
}
+
+ if (mConnection.mSdServer.mLogData) {
+ if (mConnection.mSdServer.mLogDataRemote) {
+ if (mConnection.mSdServer.mLm.mWac.isLoggedIn()) {
+ tv = (TextView) findViewById(R.id.remoteDbTv);
+ tv.setText(getString(R.string.data_sharing_status)
+ +": "
+ +getString(R.string.data_sharing_setup_ok));
+ tv.setBackgroundColor(okColour);
+ tv.setTextColor(okTextColour);
+ } else {
+ tv = (TextView) findViewById(R.id.remoteDbTv);
+ tv.setText(getString(R.string.data_sharing_status)
+ +": "
+ +getString(R.string.not_logged_in));
+ tv.setBackgroundColor(warnColour);
+ tv.setTextColor(warnTextColour);
+ }
+ } else {
+ tv = (TextView) findViewById(R.id.remoteDbTv);
+ tv.setText(getString(R.string.data_sharing_status)
+ +": "
+ +getString(R.string.not_sharing_logged_data));
+ tv.setBackgroundColor(warnColour);
+ tv.setTextColor(warnTextColour);
+ }
+ } else {
+ tv = (TextView) findViewById(R.id.remoteDbTv);
+ tv.setText(getString(R.string.data_sharing_status)
+ +": "
+ +getString(R.string.not_logging_data));
+ tv.setBackgroundColor(warnColour);
+ tv.setTextColor(warnTextColour);
+ }
+
+
// Set ProgressBars to show margin to alarm.
long powerPc;
if (mConnection.mSdServer.mSdData.alarmThresh != 0)
@@ -664,7 +700,6 @@ public class MainActivity extends AppCompatActivity {
tv.setBackgroundColor(warnColour);
tv.setTextColor(warnTextColour);
}
-
} else { // Not bound to server
tv = (TextView) findViewById(R.id.alarmTv);
tv.setText(R.string.Dashes);
@@ -694,6 +729,11 @@ public class MainActivity extends AppCompatActivity {
tv.setText(getString(R.string.WatchBatteryEquals)+" ---%");
tv.setBackgroundColor(warnColour);
tv.setTextColor(warnTextColour);
+
+ tv = (TextView) findViewById(R.id.remoteDbTv);
+ tv.setText("---");
+ tv.setBackgroundColor(warnColour);
+ tv.setTextColor(warnTextColour);
}
} catch (Exception e) {
Log.e(TAG, "ServerStatusRunnable: Exception - ");
diff --git a/app/src/main/java/uk/org/openseizuredetector/SdServer.java b/app/src/main/java/uk/org/openseizuredetector/SdServer.java
index 164a701..8ce0a67 100644
--- a/app/src/main/java/uk/org/openseizuredetector/SdServer.java
+++ b/app/src/main/java/uk/org/openseizuredetector/SdServer.java
@@ -134,8 +134,8 @@ public class SdServer extends Service implements SdDataReceiver {
// Data Logging Parameters
private boolean mLogAlarms = true;
- private boolean mLogData = false;
- private boolean mLogDataRemote = false;
+ public boolean mLogData = false;
+ public boolean mLogDataRemote = false;
private boolean mLogDataRemoteMobile = false;
private String mAuthToken = null;
private long mEventDuration = 120; // event duration in seconds - uploads datapoints that cover this time range centred on the event time.
diff --git a/app/src/main/res/layout/main.xml b/app/src/main/res/layout/main.xml
index 1a4ec7c..6a2ce10 100644
--- a/app/src/main/res/layout/main.xml
+++ b/app/src/main/res/layout/main.xml
@@ -20,16 +20,16 @@
android:id="@+id/serverStatusTv"
android:layout_width="match_parent"
android:layout_height="match_parent"
- android:gravity="center"
android:layout_weight="0.5"
+ android:gravity="center"
android:text="textView1" />
@@ -86,6 +86,11 @@
+
+