Merge branch 'V2.5'

This commit is contained in:
Graham Jones
2018-02-18 10:03:38 +00:00
32 changed files with 71 additions and 19 deletions

View File

@@ -1,6 +1,8 @@
OpenSeizureDetector Android App - Change Log OpenSeizureDetector Android App - Change Log
============================================ ============================================
V2.5.4 - 03dec2017 - Added option to use either tone generator or MP3 alarm sound, as a user reported problem with tone generator on high end samsung phone.
V2.5.3 - 10sep2017 - Added Pebble App V2.6 which provides better alarm reliability V2.5.3 - 10sep2017 - Added Pebble App V2.6 which provides better alarm reliability
- no changes to Android App other than first run dialog. - no changes to Android App other than first run dialog.

View File

@@ -43,6 +43,8 @@ Logo based on ["Star of life2" by Verdy p - Own work. Licensed under Public Doma
Other icons crated using http://romannurik.github.io/AndroidAssetStudio. Other icons crated using http://romannurik.github.io/AndroidAssetStudio.
Audio Alarm sounds from freesound https://freesound.org/people/coltonmanz/sounds/381382/, https://freesound.org/people/NoiseCollector/sounds/4270/, https://freesound.org/people/pistak23/sounds/271632/
Graham Jones, 01 March 2015. (grahamjones139+sd@gmail.com)
Graham Jones, 03 December 2017. (grahamjones139+sd@gmail.com)

View File

@@ -2,7 +2,6 @@ apply plugin: 'com.android.application'
android { android {
compileSdkVersion 24 compileSdkVersion 24
buildToolsVersion '25.0.0'
useLibrary 'org.apache.http.legacy' useLibrary 'org.apache.http.legacy'
defaultConfig { defaultConfig {

Binary file not shown.

Binary file not shown.

BIN
app/release/app-release.apk Normal file

Binary file not shown.

1
app/release/output.json Normal file
View File

@@ -0,0 +1 @@
[{"outputType":{"type":"APK"},"apkInfo":{"type":"MAIN","splits":[],"versionCode":38},"path":"app-release.apk","properties":{"packageId":"uk.org.openseizuredetector","split":"","minSdkVersion":"14"}}]

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="37" android:versionCode="38"
android:versionName="2.5.3"> android:versionName="2.5.4">
<uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" /> <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />

View File

@@ -45,7 +45,9 @@ import android.content.SharedPreferences;
import android.graphics.drawable.Drawable; import android.graphics.drawable.Drawable;
import android.location.Location; import android.location.Location;
import android.media.AudioManager; import android.media.AudioManager;
import android.media.RingtoneManager;
import android.media.ToneGenerator; import android.media.ToneGenerator;
import android.net.Uri;
import android.os.CountDownTimer; import android.os.CountDownTimer;
import android.os.Environment; import android.os.Environment;
import android.os.Handler; import android.os.Handler;
@@ -56,7 +58,7 @@ import android.os.Looper;
import android.os.PowerManager; import android.os.PowerManager;
import android.os.PowerManager.WakeLock; import android.os.PowerManager.WakeLock;
import android.preference.PreferenceManager; import android.preference.PreferenceManager;
import android.support.v7.app.NotificationCompat; import android.support.v4.app.NotificationCompat;
import android.telephony.SmsManager; import android.telephony.SmsManager;
import android.location.Location; import android.location.Location;
import android.util.Log; import android.util.Log;
@@ -106,9 +108,10 @@ public class SdServer extends Service implements SdDataReceiver, SdLocationRecei
private int mLatchAlarmPeriod = 0; private int mLatchAlarmPeriod = 0;
private LatchAlarmTimer mLatchAlarmTimer = null; private LatchAlarmTimer mLatchAlarmTimer = null;
private boolean mCancelAudible = false; private boolean mCancelAudible = false;
public boolean mAudibleAlarm = false; public boolean mAudibleAlarm = false; // set to public because it is accessed by MainActivity
private boolean mAudibleWarning = false; private boolean mAudibleWarning = false;
private boolean mAudibleFaultWarning = false; private boolean mAudibleFaultWarning = false;
private boolean mMp3Alarm = false;
private boolean mSMSAlarm = false; private boolean mSMSAlarm = false;
private String[] mSMSNumbers; private String[] mSMSNumbers;
private String mSMSMsgStr = "default SMS Message"; private String mSMSMsgStr = "default SMS Message";
@@ -516,7 +519,7 @@ public class SdServer extends Service implements SdDataReceiver, SdLocationRecei
/* from http://stackoverflow.com/questions/12154940/how-to-make-a-beep-in-android */ /* from http://stackoverflow.com/questions/12154940/how-to-make-a-beep-in-android */
/** /**
* beep for duration milliseconds, but only if mAudibleAlarm is set. * beep for duration milliseconds, using tone generator
*/ */
private void beep(int duration) { private void beep(int duration) {
if (mToneGenerator != null) { if (mToneGenerator != null) {
@@ -538,7 +541,20 @@ public class SdServer extends Service implements SdDataReceiver, SdLocationRecei
Log.v(TAG, "faultWarningBeep() - CancelAudible Active - silent beep..."); Log.v(TAG, "faultWarningBeep() - CancelAudible Active - silent beep...");
} else { } else {
if (mAudibleFaultWarning) { if (mAudibleFaultWarning) {
beep(10); if (mMp3Alarm) {
Log.v(TAG,"making MP3 alarm beep");
// From https://stackoverflow.com/questions/4441334/how-to-play-an-android-notification-sound
// This plays an audio file as a notification, using the notification sound channel.
NotificationManager notificationManager =
(NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
Uri soundUri = Uri.parse("android.resource://"+getPackageName()+"/raw/fault");
NotificationCompat.Builder mBuilder =
new NotificationCompat.Builder(getApplicationContext())
.setSound(soundUri); //This sets the sound to play
notificationManager.notify(0, mBuilder.build());
} else {
beep(10);
}
Log.v(TAG, "faultWarningBeep()"); Log.v(TAG, "faultWarningBeep()");
mUtil.writeToSysLogFile("SdServer.faultWarningBeep() - beeping"); mUtil.writeToSysLogFile("SdServer.faultWarningBeep() - beeping");
} else { } else {
@@ -561,7 +577,20 @@ public class SdServer extends Service implements SdDataReceiver, SdLocationRecei
Log.v(TAG, "alarmBeep() - CancelAudible Active - silent beep..."); Log.v(TAG, "alarmBeep() - CancelAudible Active - silent beep...");
} else { } else {
if (mAudibleAlarm) { if (mAudibleAlarm) {
beep(3000); if (mMp3Alarm) {
Log.v(TAG,"making MP3 alarm beep");
// From https://stackoverflow.com/questions/4441334/how-to-play-an-android-notification-sound
// This plays an audio file as a notification, using the notification sound channel.
NotificationManager notificationManager =
(NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
Uri soundUri = Uri.parse("android.resource://"+getPackageName()+"/raw/alarm");
NotificationCompat.Builder mBuilder =
new NotificationCompat.Builder(getApplicationContext())
.setSound(soundUri); //This sets the sound to play
notificationManager.notify(0, mBuilder.build());
} else {
beep(3000);
}
Log.v(TAG, "alarmBeep()"); Log.v(TAG, "alarmBeep()");
mUtil.writeToSysLogFile("SdServer.alarmBeep() - beeping"); mUtil.writeToSysLogFile("SdServer.alarmBeep() - beeping");
} else { } else {
@@ -578,7 +607,20 @@ public class SdServer extends Service implements SdDataReceiver, SdLocationRecei
Log.v(TAG, "warningBeep() - CancelAudible Active - silent beep..."); Log.v(TAG, "warningBeep() - CancelAudible Active - silent beep...");
} else { } else {
if (mAudibleWarning) { if (mAudibleWarning) {
beep(100); if (mMp3Alarm) {
Log.v(TAG,"making MP3 alarm beep");
// From https://stackoverflow.com/questions/4441334/how-to-play-an-android-notification-sound
// This plays an audio file as a notification, using the notification sound channel.
NotificationManager notificationManager =
(NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
Uri soundUri = Uri.parse("android.resource://"+getPackageName()+"/raw/warning");
NotificationCompat.Builder mBuilder =
new NotificationCompat.Builder(getApplicationContext())
.setSound(soundUri); //This sets the sound to play
notificationManager.notify(0, mBuilder.build());
} else {
beep(100);
}
Log.v(TAG, "warningBeep()"); Log.v(TAG, "warningBeep()");
mUtil.writeToSysLogFile("SdServer.warningBeep() - beeping"); mUtil.writeToSysLogFile("SdServer.warningBeep() - beeping");
} else { } else {
@@ -837,6 +879,9 @@ public class SdServer extends Service implements SdDataReceiver, SdLocationRecei
Log.v(TAG, "updatePrefs() - mAuidbleAlarm = " + mAudibleAlarm); Log.v(TAG, "updatePrefs() - mAuidbleAlarm = " + mAudibleAlarm);
mAudibleWarning = SP.getBoolean("AudibleWarning", true); mAudibleWarning = SP.getBoolean("AudibleWarning", true);
Log.v(TAG, "updatePrefs() - mAuidbleWarning = " + mAudibleWarning); Log.v(TAG, "updatePrefs() - mAuidbleWarning = " + mAudibleWarning);
mMp3Alarm = SP.getBoolean("UseMp3Alarm", false);
Log.v(TAG, "updatePrefs() - mMp3Alarm = " + mMp3Alarm);
mSMSAlarm = SP.getBoolean("SMSAlarm", false); mSMSAlarm = SP.getBoolean("SMSAlarm", false);
Log.v(TAG, "updatePrefs() - mSMSAlarm = " + mSMSAlarm); Log.v(TAG, "updatePrefs() - mSMSAlarm = " + mSMSAlarm);
String SMSNumberStr = SP.getString("SMSNumbers", ""); String SMSNumberStr = SP.getString("SMSNumbers", "");

View File

@@ -461,8 +461,8 @@ 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- Upgraded Pebble watch app to V2.6, which improves alarm detection annunciation." + "\n- Added option to use MP3 alarm notification sounds rather than the default."
+ "\n- Use the 'Install Watch App' menu option to upgrade the application on the watch." + "\n- as some users had reported the default sound not working."
); );
// 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);
@@ -492,10 +492,8 @@ 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- Update to Detection Algorithm: You will need to increase the AlarmRatioThresh setting from the previous " + "\n- Added option to use MP3 alarm notification sounds rather than the default."
+ "default of around 30 to a value of 50-60 to avoid excessive false alarms" + "\n- as some users had reported the default sound not working."
+ "\n- Added GPS Location to SMS Alarms"
+ "\n- Added auto-start on boot capability"
); );
// 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);

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -36,6 +36,11 @@
android:summary="Duration that fault alarms are muted before initiating." android:summary="Duration that fault alarms are muted before initiating."
android:numeric="integer" android:numeric="integer"
android:defaultValue="30" /> android:defaultValue="30" />
<CheckBoxPreference
android:defaultValue="false"
android:key="UseMp3Alarm"
android:summary="Play an MP3 file to create the alarm beeps rather than using the default tone generator."
android:title="Use MP3 Alarm Sound" />
</PreferenceCategory> </PreferenceCategory>

View File

@@ -4,7 +4,7 @@ buildscript {
jcenter() jcenter()
} }
dependencies { dependencies {
classpath 'com.android.tools.build:gradle:2.3.3' classpath 'com.android.tools.build:gradle:3.0.1'
} }
} }
allprojects { allprojects {

View File

@@ -1,6 +1,6 @@
#Sun May 07 14:37:42 BST 2017 #Sun Dec 03 09:39:36 GMT 2017
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-3.3-all.zip distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip