V3.11 - Fixed heart rate reporting in network datasource

This commit is contained in:
Graham Jones
2019-10-23 20:18:22 +01:00
parent 102a5c2a94
commit 384bb7c9a3
10 changed files with 37 additions and 24 deletions

View File

@@ -4,6 +4,9 @@
V3.2.0 - (NEXT VERSION!) V3.2.0 - (NEXT VERSION!)
- Added neural network based data analysis. - Added neural network based data analysis.
V3.1.11 - 23oct2019
- Updated network data source so it displays heart rate data if it is available.
V3.1.10 - 20oct2019 V3.1.10 - 20oct2019
- Added option to make a 'null' heart rate reading an alarm rather than fault condition. - Added option to make a 'null' heart rate reading an alarm rather than fault condition.

Binary file not shown.

View File

@@ -1 +1 @@
[{"outputType":{"type":"APK"},"apkData":{"type":"MAIN","splits":[],"versionCode":64,"versionName":"3.1.10","enabled":true,"outputFile":"app-release.apk","fullName":"release","baseName":"release"},"path":"app-release.apk","properties":{}}] [{"outputType":{"type":"APK"},"apkData":{"type":"MAIN","splits":[],"versionCode":65,"versionName":"3.1.11","enabled":true,"outputFile":"app-release.apk","fullName":"release","baseName":"release"},"path":"app-release.apk","properties":{}}]

View File

@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" <manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="uk.org.openseizuredetector" package="uk.org.openseizuredetector"
android:versionCode="64" android:versionCode="65"
android:versionName="3.1.10" android:versionName="3.1.11"
> >
<!--android:allowBackup="false"--> <!--android:allowBackup="false"-->
@@ -20,6 +20,7 @@
<uses-permission android:name="android.permission.FOREGROUND_SERVICE"/> <uses-permission android:name="android.permission.FOREGROUND_SERVICE"/>
<uses-permission android:name="android.permission.READ_PHONE_STATE"/> <uses-permission android:name="android.permission.READ_PHONE_STATE"/>
<uses-feature <uses-feature
android:name="android.hardware.telephony" android:name="android.hardware.telephony"
android:required="false" /> android:required="false" />
@@ -28,7 +29,11 @@
<application <application
android:theme="@style/Theme.AppCompat" android:theme="@style/Theme.AppCompat"
android:icon="@drawable/star_of_life_48x48" android:icon="@drawable/star_of_life_48x48"
android:label="@string/app_name"> android:label="@string/app_name"
android:networkSecurityConfig="@xml/network_security_config"
>
<!--android:usesCleartextTraffic="true"-->
<activity android:name=".StartupActivity"> <activity android:name=".StartupActivity">
<intent-filter> <intent-filter>
<action android:name="android.intent.action.MAIN" /> <action android:name="android.intent.action.MAIN" />
@@ -64,7 +69,6 @@
<uses-library <uses-library
android:name="org.apache.http.legacy" android:name="org.apache.http.legacy"
android:required="false" /> android:required="false" />
</application> </application>

View File

@@ -64,7 +64,7 @@ public class SdData implements Parcelable {
public boolean mHRAlarmActive = false; public boolean mHRAlarmActive = false;
public boolean mHRNullAsAlarm = false; public boolean mHRNullAsAlarm = false;
public double mHRThreshMin = 40.0; public double mHRThreshMin = 40.0;
public double mHRTreshMax = 150.0; public double mHRThreshMax = 150.0;
public double rawData[]; public double rawData[];
int mNsamp = 0; int mNsamp = 0;
@@ -120,7 +120,13 @@ public class SdData implements Parcelable {
alarmPhrase = jo.optString("alarmPhrase"); alarmPhrase = jo.optString("alarmPhrase");
alarmThresh = jo.optInt("alarmThresh"); alarmThresh = jo.optInt("alarmThresh");
alarmRatioThresh = jo.optInt("alarmRatioThresh"); alarmRatioThresh = jo.optInt("alarmRatioThresh");
mHRAlarmActive=jo.optBoolean("hrAlarmActive");
mHRThreshMin = jo.optDouble("hrThreshMin");
mHRThreshMax = jo.optDouble("hrThreshMax");
mHR = jo.optDouble("hr"); mHR = jo.optDouble("hr");
if (mHR>=0.0) {
mHRAlarmActive = true;
}
JSONArray specArr = jo.optJSONArray("simpleSpec"); JSONArray specArr = jo.optJSONArray("simpleSpec");
for (int i = 0; i < specArr.length(); i++) { for (int i = 0; i < specArr.length(); i++) {
simpleSpec[i] = specArr.optInt(i); simpleSpec[i] = specArr.optInt(i);
@@ -169,6 +175,9 @@ public class SdData implements Parcelable {
jsonObj.put("alarmFreqMax",alarmFreqMax); jsonObj.put("alarmFreqMax",alarmFreqMax);
jsonObj.put("alarmThresh", alarmThresh); jsonObj.put("alarmThresh", alarmThresh);
jsonObj.put("alarmRatioThresh", alarmRatioThresh); jsonObj.put("alarmRatioThresh", alarmRatioThresh);
jsonObj.put("hrAlarmActive", mHRAlarmActive);
jsonObj.put("hrThreshMin",mHRThreshMin);
jsonObj.put("hrThreshMax", mHRThreshMax);
jsonObj.put("hr",mHR); jsonObj.put("hr",mHR);
JSONArray arr = new JSONArray(); JSONArray arr = new JSONArray();
for (int i = 0; i < simpleSpec.length; i++) { for (int i = 0; i < simpleSpec.length; i++) {

View File

@@ -330,8 +330,8 @@ public class SdDataSourceGarmin extends SdDataSource {
Log.v(TAG, "updatePrefs() HRThreshMin = " + mSdData.mHRThreshMin); Log.v(TAG, "updatePrefs() HRThreshMin = " + mSdData.mHRThreshMin);
prefStr = SP.getString("HRThreshMax", "SET_FROM_XML"); prefStr = SP.getString("HRThreshMax", "SET_FROM_XML");
mSdData.mHRTreshMax = (short) Integer.parseInt(prefStr); mSdData.mHRThreshMax = (short) Integer.parseInt(prefStr);
Log.v(TAG, "updatePrefs() HRThreshMax = " + mSdData.mHRTreshMax); Log.v(TAG, "updatePrefs() HRThreshMax = " + mSdData.mHRThreshMax);
} else { } else {
Log.v(TAG, "updatePrefs() - prefStr is null - WHY????"); Log.v(TAG, "updatePrefs() - prefStr is null - WHY????");
@@ -590,7 +590,7 @@ public class SdDataSourceGarmin extends SdDataSource {
mSdData.mHRAlarmStanding = false; mSdData.mHRAlarmStanding = false;
} }
} }
else if ((mSdData.mHR > mSdData.mHRTreshMax) || (mSdData.mHR < mSdData.mHRThreshMin)) { else if ((mSdData.mHR > mSdData.mHRThreshMax) || (mSdData.mHR < mSdData.mHRThreshMin)) {
Log.i(TAG, "Heart Rate Abnormal - " + mSdData.mHR + " bpm"); Log.i(TAG, "Heart Rate Abnormal - " + mSdData.mHR + " bpm");
mSdData.mHRFaultStanding = false; mSdData.mHRFaultStanding = false;
mSdData.mHRAlarmStanding = true; mSdData.mHRAlarmStanding = true;

View File

@@ -408,13 +408,9 @@ public class StartupActivity extends Activity {
+ "http://openseizuredetector.org.uk, or the app Facebook page at https://www.facebook.com/openseizuredetector. " + "http://openseizuredetector.org.uk, or the app Facebook page at https://www.facebook.com/openseizuredetector. "
+ "so I can get in touch if necessary.\nThank you! Graham \ngraham@openseizuredetector.org.uk " + "so I can get in touch if necessary.\nThank you! Graham \ngraham@openseizuredetector.org.uk "
+ "\n\nChanges in this version:" + "\n\nChanges in this version:"
+ "\n- V3.1.0 - Added fall detection algorithm into Garmin/Fitbit Data Source " + "\n V3.1.11 - Fixed issue that Nework data source did not display heart rate data"
+ "\n V3.1.3 - Added delay to SMS sending to give the user chance to cancel a false alarm."
+ "\n V3.1.5 - Added repeat alarm beeps during SMS delay to alert user.."
+ "\n V3.1.6 - Made Cancel Audible button inhibit sending SMS alarms as well as audible beeps"
+ "\n V3.1.8 - Added READ_PHONE_STATE permission, which seems to be needed for some phones"
+ "\n V3.1.9 - Fixed issue with Garmin Seizure Detector not producing warnings. Added fault pips for missing heart rate data if heart rate alarm active"
+ "\n V3.1.10 - Provided a user option to treat a null heart rate as a fault or an alarm condition" + "\n V3.1.10 - Provided a user option to treat a null heart rate as a fault or an alarm condition"
+ "\n V3.1.9 - Fixed issue with Garmin Seizure Detector not producing warnings. Added fault pips for missing heart rate data if heart rate alarm active"
); );
// This makes the links display as links, but they do not respond to clicks for some reason... // This makes the links display as links, but they do not respond to clicks for some reason...
Linkify.addLinks(s, Linkify.ALL); Linkify.addLinks(s, Linkify.ALL);
@@ -444,13 +440,9 @@ public class StartupActivity extends Activity {
+ "http://openseizuredetector.org.uk, or the app Facebook page at https://www.facebook.com/openseizuredetector. " + "http://openseizuredetector.org.uk, or the app Facebook page at https://www.facebook.com/openseizuredetector. "
+ "so I can get in touch if necessary.\nThank you! Graham \ngraham@openseizuredetector.org.uk " + "so I can get in touch if necessary.\nThank you! Graham \ngraham@openseizuredetector.org.uk "
+ "\n\nChanges in this version:" + "\n\nChanges in this version:"
+ "\n- V3.1.0 - Added fall detection algorithm into Garmin/Fitbit Data Source " + "\n V3.1.11 - Fixed issue that Nework data source did not display heart rate data"
+ "\n V3.1.3 - Added delay to SMS sending to give the user chance to cancel a false alarm."
+ "\n V3.1.5 - Added repeat alarm beeps during SMS delay to alert user.."
+ "\n V3.1.6 - Made Cancel Audible button inhibit sending SMS alarms as well as audible beeps"
+ "\n V3.1.8 - Added READ_PHONE_STATE permission, which seems to be needed for some phones"
+ "\n V3.1.9 - Fixed issue with Garmin Seizure Detector not producing warnings. Added faut pips for missing heart rate data if heart rate alarm active"
+ "\n V3.1.10 - Provided a user option to treat a null heart rate as a fault or an alarm condition" + "\n V3.1.10 - Provided a user option to treat a null heart rate as a fault or an alarm condition"
+ "\n V3.1.9 - Fixed issue with Garmin Seizure Detector not producing warnings. Added fault pips for missing heart rate data if heart rate alarm active"
+ "\n " + "\n "
); );
// This makes the links display as links, but they do not respond to clicks for some reason... // This makes the links display as links, but they do not respond to clicks for some reason...

View File

@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<network-security-config>
<!-- Set application-wide security config using base-config tag.-->
<base-config cleartextTrafficPermitted="true"/>
</network-security-config>

View File

@@ -9,7 +9,7 @@ buildscript {
google() google()
} }
dependencies { dependencies {
classpath 'com.android.tools.build:gradle:3.4.2' classpath 'com.android.tools.build:gradle:3.5.1'
} }
} }
allprojects { allprojects {

View File

@@ -1,6 +1,6 @@
#Mon Apr 22 16:59:24 BST 2019 #Wed Oct 23 19:45:23 BST 2019
distributionBase=GRADLE_USER_HOME distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.1.1-all.zip distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip