diff --git a/README.md b/README.md index 75c4b9f..102b946 100644 --- a/README.md +++ b/README.md @@ -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. +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) diff --git a/app/app-release-2.0.1.apk b/app/release/app-release-2.0.1.apk similarity index 100% rename from app/app-release-2.0.1.apk rename to app/release/app-release-2.0.1.apk diff --git a/app/app-release-2.0.2.apk b/app/release/app-release-2.0.2.apk similarity index 100% rename from app/app-release-2.0.2.apk rename to app/release/app-release-2.0.2.apk diff --git a/app/app-release-2.0.3.apk b/app/release/app-release-2.0.3.apk similarity index 100% rename from app/app-release-2.0.3.apk rename to app/release/app-release-2.0.3.apk diff --git a/app/app-release-2.0.4.apk b/app/release/app-release-2.0.4.apk similarity index 100% rename from app/app-release-2.0.4.apk rename to app/release/app-release-2.0.4.apk diff --git a/app/app-release-2.0.6.apk b/app/release/app-release-2.0.6.apk similarity index 100% rename from app/app-release-2.0.6.apk rename to app/release/app-release-2.0.6.apk diff --git a/app/app-release-2.0.7.apk b/app/release/app-release-2.0.7.apk similarity index 100% rename from app/app-release-2.0.7.apk rename to app/release/app-release-2.0.7.apk diff --git a/app/app-release-2.0.8.apk b/app/release/app-release-2.0.8.apk similarity index 100% rename from app/app-release-2.0.8.apk rename to app/release/app-release-2.0.8.apk diff --git a/app/app-release-2.0.apk b/app/release/app-release-2.0.apk similarity index 100% rename from app/app-release-2.0.apk rename to app/release/app-release-2.0.apk diff --git a/app/app-release-2.0b.apk b/app/release/app-release-2.0b.apk similarity index 100% rename from app/app-release-2.0b.apk rename to app/release/app-release-2.0b.apk diff --git a/app/app-release-2.0c.apk b/app/release/app-release-2.0c.apk similarity index 100% rename from app/app-release-2.0c.apk rename to app/release/app-release-2.0c.apk diff --git a/app/app-release-2.0d.apk b/app/release/app-release-2.0d.apk similarity index 100% rename from app/app-release-2.0d.apk rename to app/release/app-release-2.0d.apk diff --git a/app/app-release-2.3.0.apk b/app/release/app-release-2.3.0.apk similarity index 100% rename from app/app-release-2.3.0.apk rename to app/release/app-release-2.3.0.apk diff --git a/app/app-release-2.3.1.apk b/app/release/app-release-2.3.1.apk similarity index 100% rename from app/app-release-2.3.1.apk rename to app/release/app-release-2.3.1.apk diff --git a/app/app-release-2.3.2.apk b/app/release/app-release-2.3.2.apk similarity index 100% rename from app/app-release-2.3.2.apk rename to app/release/app-release-2.3.2.apk diff --git a/app/app-release-2.5.1.apk b/app/release/app-release-2.5.1.apk similarity index 100% rename from app/app-release-2.5.1.apk rename to app/release/app-release-2.5.1.apk diff --git a/app/app-release-2.5.2.apk b/app/release/app-release-2.5.2.apk similarity index 100% rename from app/app-release-2.5.2.apk rename to app/release/app-release-2.5.2.apk diff --git a/app/release/app-release-2.5.3.apk b/app/release/app-release-2.5.3.apk new file mode 100644 index 0000000..b6a606c Binary files /dev/null and b/app/release/app-release-2.5.3.apk differ diff --git a/app/release/app-release-2.5.4.apk b/app/release/app-release-2.5.4.apk new file mode 100644 index 0000000..db89ad3 Binary files /dev/null and b/app/release/app-release-2.5.4.apk differ diff --git a/app/release/app-release.apk b/app/release/app-release.apk new file mode 100644 index 0000000..db89ad3 Binary files /dev/null and b/app/release/app-release.apk differ diff --git a/app/release/output.json b/app/release/output.json new file mode 100644 index 0000000..875bdfd --- /dev/null +++ b/app/release/output.json @@ -0,0 +1 @@ +[{"outputType":{"type":"APK"},"apkInfo":{"type":"MAIN","splits":[],"versionCode":38},"path":"app-release.apk","properties":{"packageId":"uk.org.openseizuredetector","split":"","minSdkVersion":"14"}}] \ No newline at end of file diff --git a/app/src/main/java/uk/org/openseizuredetector/SdServer.java b/app/src/main/java/uk/org/openseizuredetector/SdServer.java index 4383592..cc56ca8 100644 --- a/app/src/main/java/uk/org/openseizuredetector/SdServer.java +++ b/app/src/main/java/uk/org/openseizuredetector/SdServer.java @@ -541,7 +541,20 @@ public class SdServer extends Service implements SdDataReceiver, SdLocationRecei Log.v(TAG, "faultWarningBeep() - CancelAudible Active - silent beep..."); } else { 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()"); mUtil.writeToSysLogFile("SdServer.faultWarningBeep() - beeping"); } else { @@ -567,15 +580,13 @@ public class SdServer extends Service implements SdDataReceiver, SdLocationRecei 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); - //Define sound URI - Uri soundUri = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION); + Uri soundUri = Uri.parse("android.resource://"+getPackageName()+"/raw/alarm"); NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(getApplicationContext()) .setSound(soundUri); //This sets the sound to play - -//Display notification notificationManager.notify(0, mBuilder.build()); } else { beep(3000); @@ -596,7 +607,20 @@ public class SdServer extends Service implements SdDataReceiver, SdLocationRecei Log.v(TAG, "warningBeep() - CancelAudible Active - silent beep..."); } else { 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()"); mUtil.writeToSysLogFile("SdServer.warningBeep() - beeping"); } else { diff --git a/app/src/main/res/raw/alarm.wav b/app/src/main/res/raw/alarm.wav new file mode 100644 index 0000000..de8bab5 Binary files /dev/null and b/app/src/main/res/raw/alarm.wav differ diff --git a/app/src/main/res/raw/fault.mp3 b/app/src/main/res/raw/fault.mp3 new file mode 100644 index 0000000..86d7dea Binary files /dev/null and b/app/src/main/res/raw/fault.mp3 differ diff --git a/app/src/main/res/raw/warning.wav b/app/src/main/res/raw/warning.wav new file mode 100644 index 0000000..2779a1d Binary files /dev/null and b/app/src/main/res/raw/warning.wav differ