V4.0.0 - updated about dialog text to make it tidier. Added buttons for privacy policy to dialogs.

This commit is contained in:
Graham Jones
2022-03-11 18:33:51 +00:00
parent 90f8b4fdcf
commit 5b877820c4
9 changed files with 127 additions and 76 deletions

Binary file not shown.

Binary file not shown.

View File

@@ -3,7 +3,7 @@
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
package="uk.org.openseizuredetector" package="uk.org.openseizuredetector"
android:versionCode="97" android:versionCode="97"
android:versionName="4.0.0v"> android:versionName="4.0.0">
<!-- android:allowBackup="false" --> <!-- android:allowBackup="false" -->
<uses-permission android:name="android.permission.BLUETOOTH" /> <uses-permission android:name="android.permission.BLUETOOTH" />
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" /> <uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />

View File

@@ -31,6 +31,7 @@ import android.content.Intent;
import android.content.SharedPreferences; import android.content.SharedPreferences;
import android.graphics.Color; import android.graphics.Color;
import android.graphics.drawable.Drawable; import android.graphics.drawable.Drawable;
import android.net.Uri;
import android.os.Bundle; import android.os.Bundle;
import android.os.Handler; import android.os.Handler;
import android.os.Message; import android.os.Message;
@@ -970,7 +971,31 @@ public class MainActivity extends AppCompatActivity {
AlertDialog.Builder builder = new AlertDialog.Builder(this); AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setIcon(R.drawable.icon_24x24); builder.setIcon(R.drawable.icon_24x24);
builder.setTitle("OpenSeizureDetector V" + versionName); builder.setTitle("OpenSeizureDetector V" + versionName);
builder.setPositiveButton("OK", null); builder.setNeutralButton(getString(R.string.closeBtnTxt), new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
dialog.cancel();
}
});
builder.setPositiveButton("Privacy Policy", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
dialog.cancel();
String url = OsdUtil.PRIVACY_POLICY_URL;
Intent i = new Intent(Intent.ACTION_VIEW);
i.setData(Uri.parse(url));
startActivity(i);
dialog.cancel();
}
});
builder.setNegativeButton("Data Sharing", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
dialog.cancel();
String url = OsdUtil.DATA_SHARING_URL;
Intent i = new Intent(Intent.ACTION_VIEW);
i.setData(Uri.parse(url));
startActivity(i);
dialog.cancel();
}
});
builder.setView(aboutView); builder.setView(aboutView);
builder.create(); builder.create();
builder.show(); builder.show();

View File

@@ -72,6 +72,9 @@ import java.util.function.Consumer;
* Deals with starting and stopping the background service and binding to it to receive data. * Deals with starting and stopping the background service and binding to it to receive data.
*/ */
public class OsdUtil { public class OsdUtil {
public final static String PRIVACY_POLICY_URL = "https://www.openseizuredetector.org.uk/?page_id=1415";
public final static String DATA_SHARING_URL = "https://www.openseizuredetector.org.uk/?page_id=1818";
private final String SYSLOG = "SysLog"; private final String SYSLOG = "SysLog";
private final String ALARMLOG = "AlarmLog"; private final String ALARMLOG = "AlarmLog";
private final String DATALOG = "DataLog"; private final String DATALOG = "DataLog";

View File

@@ -33,10 +33,12 @@ import android.content.SharedPreferences;
import android.content.pm.PackageInfo; import android.content.pm.PackageInfo;
import android.content.pm.PackageManager; import android.content.pm.PackageManager;
import android.graphics.Color; import android.graphics.Color;
import android.net.Uri;
import android.os.Bundle; import android.os.Bundle;
import android.os.Handler; import android.os.Handler;
import android.os.PowerManager; import android.os.PowerManager;
import android.preference.PreferenceManager; import android.preference.PreferenceManager;
import android.text.Html;
import android.text.SpannableString; import android.text.SpannableString;
import android.text.util.Linkify; import android.text.util.Linkify;
import android.util.Log; import android.util.Log;
@@ -50,6 +52,7 @@ import androidx.appcompat.app.AlertDialog;
import androidx.appcompat.app.AppCompatActivity; import androidx.appcompat.app.AppCompatActivity;
import androidx.core.app.ActivityCompat; import androidx.core.app.ActivityCompat;
import androidx.core.content.ContextCompat; import androidx.core.content.ContextCompat;
import androidx.core.text.HtmlCompat;
import com.rohitss.uceh.UCEHandler; import com.rohitss.uceh.UCEHandler;
@@ -460,10 +463,10 @@ public class StartupActivity extends AppCompatActivity {
} }
} }
/** /**
* checkFirstRun - checks to see if this is the first run of the app after installation or upgrade. * checkFirstRun - checks to see if this is the first run of the app after installation or upgrade.
* if it is, the relevant dialog message is displayed. If not, the routine just exists so start-up can continue. * if it is, the relevant dialog message is displayed. If not, the routine just exists so start-up can continue.
*/ */
public void checkFirstRun() { public void checkFirstRun() {
String storedVersionName = ""; String storedVersionName = "";
String versionName; String versionName;
@@ -477,25 +480,48 @@ public class StartupActivity extends AppCompatActivity {
Log.v(TAG, "storedVersionName=" + storedVersionName + ", versionName=" + versionName); Log.v(TAG, "storedVersionName=" + storedVersionName + ", versionName=" + versionName);
// CHeck for new installation // CHeck for new installation
//storedVersionName = null; // FIXME Force first run dialog for easier testing ****************************
if (storedVersionName == null || storedVersionName.length() == 0) { if (storedVersionName == null || storedVersionName.length() == 0) {
AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder( AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(
this); this);
final SpannableString s = new SpannableString( final String s = new String(
getString(R.string.FirstRunDlgMsg) + getString(R.string.changelog) getString(R.string.FirstRunDlgMsg));
);
// This makes the links display as links, but they do not respond to clicks for some reason...
Linkify.addLinks(s, Linkify.ALL);
alertDialogBuilder alertDialogBuilder
.setTitle(getString(R.string.FirstRunDlgTitle)) .setTitle(getString(R.string.FirstRunDlgTitle))
.setMessage(s) .setMessage(Html.fromHtml(s))
.setCancelable(false) .setCancelable(false)
.setPositiveButton(getString(R.string.okBtnTxt), new DialogInterface.OnClickListener() { .setNeutralButton(getString(R.string.closeBtnTxt), new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) { public void onClick(DialogInterface dialog, int id) {
dialog.cancel(); dialog.cancel();
mDialogDisplayed = false; mDialogDisplayed = false;
//MainActivity.this.finish(); //MainActivity.this.finish();
} }
}); })
.setPositiveButton("Privacy Policy", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
dialog.cancel();
mDialogDisplayed = false;
String url = OsdUtil.PRIVACY_POLICY_URL;
Intent i = new Intent(Intent.ACTION_VIEW);
i.setData(Uri.parse(url));
startActivity(i);
dialog.cancel();
mDialogDisplayed = false;
}
})
.setNegativeButton("Data Sharing", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
dialog.cancel();
mDialogDisplayed = false;
String url = OsdUtil.DATA_SHARING_URL;
Intent i = new Intent(Intent.ACTION_VIEW);
i.setData(Uri.parse(url));
startActivity(i);
dialog.cancel();
mDialogDisplayed = false;
}
})
;
FirstRunDialog = alertDialogBuilder.create(); FirstRunDialog = alertDialogBuilder.create();
Log.i(TAG, "Displaying First Run Dialog"); Log.i(TAG, "Displaying First Run Dialog");
FirstRunDialog.show(); FirstRunDialog.show();
@@ -504,19 +530,43 @@ public class StartupActivity extends AppCompatActivity {
// Check for update of installed application // Check for update of installed application
AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder( AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(
this); this);
final SpannableString s = new SpannableString( final String s = new String(
getString(R.string.UpgradeMsg) + getString(R.string.changelog) getString(R.string.UpgradeMsg) + getString(R.string.changelog)
); );
// This makes the links display as links, but they do not respond to clicks for some reason...
Linkify.addLinks(s, Linkify.ALL);
alertDialogBuilder alertDialogBuilder
.setTitle(getString(R.string.UpdateDialogTitleTxt)) .setTitle(getString(R.string.UpdateDialogTitleTxt))
.setMessage(s) .setMessage(Html.fromHtml(s))
.setCancelable(false) .setCancelable(false)
.setPositiveButton(getString(R.string.okBtnTxt), new DialogInterface.OnClickListener() { .setNeutralButton(getString(R.string.closeBtnTxt), new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) { public void onClick(DialogInterface dialog, int id) {
dialog.cancel(); dialog.cancel();
mDialogDisplayed = false; mDialogDisplayed = false;
//MainActivity.this.finish();
}
})
.setPositiveButton("Privacy Policy", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
dialog.cancel();
mDialogDisplayed = false;
String url = OsdUtil.PRIVACY_POLICY_URL;
Intent i = new Intent(Intent.ACTION_VIEW);
i.setData(Uri.parse(url));
startActivity(i);
dialog.cancel();
mDialogDisplayed = false;
}
})
.setNegativeButton("Data Sharing", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
dialog.cancel();
mDialogDisplayed = false;
String url = OsdUtil.DATA_SHARING_URL;
Intent i = new Intent(Intent.ACTION_VIEW);
i.setData(Uri.parse(url));
startActivity(i);
dialog.cancel();
mDialogDisplayed = false;
} }
}); });
UpdateDialog = alertDialogBuilder.create(); UpdateDialog = alertDialogBuilder.create();

View File

@@ -21,15 +21,5 @@
android:text="@string/about_text" android:text="@string/about_text"
/> />
<TextView
android:id="@+id/about_credits"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="20dip"
android:textSize="16sp"
android:text="@string/credits_text"
android:autoLink="web"
/>
</LinearLayout> </LinearLayout>
</ScrollView> </ScrollView>

View File

@@ -3,40 +3,36 @@
<string name="app_name">OpenSeizureDetector</string> <string name="app_name">OpenSeizureDetector</string>
<string name="changelog"> <string name="changelog">
"\n "\n
\nV4.0.0v - Added BLE Characteristic changes for PineWatch, added cancel buttons to permissions dialogs. \nV4.0.0
\nV4.0.0t - Fixed issue with occasional crashes when network disrupted. Improved 'Prominent Disclosure' of SMS and Location permissions to satisfy Google Play Store requirements. - Introduced the &lt;b>Data Sharing&lt;/b> feature to allow users to share their seizure and false alarm data
\nV4.0.0s - Fixed problem with Android 11 not sending SMS Location alerts. with researchers to help improve the system.&lt;br/>
\nV4.0.0p - Restored compatibility with Android V6 - Fixed &lt;b>SMS Location Alerts&lt;/b> on Android V10+ (new permissions screens)&lt;br/>
\nV4.0.0n - Fixed issue with system not shutting down after accessing the event editor screen. - Added explicit link to the &lt;b>Privacy Policy&lt;/b> &lt;br/>
\nV4.0.0m - Minor tweaks to UI to show O2Sat as --- if no O2 sensor is present and avoid displaying error while waiting for "</string>
first data sharing update.
\nV4.0.0l - Added prompt for user if data sharing is not enabled.
\nV4.0.0k - Added user name and user ID to login activity so the user knows who they are logged in as.
\nV4.0.0j - Added event ID to list in data log manager so users can refer to it when asking for assistance.
\n Moved system log to sqlite database and added list of it to data log manager activity.
\nV4.0.0i - Tidied up user settings and (hopefully) fixed issue with server not shutting down correctly sometimes.
"</string>
<string name="UpgradeMsg"> <string name="UpgradeMsg">
OpenSeizureDetector does not collect any personal data other than through the Data Sharing system that allows your seizure events to be analysed to improve detection reliability and false alarm rate (see https://www.openseizuredetector.org.uk/?page_id=1818) Please enable the new &lt;b>Data Sharing&lt;/b> feature to help improve OpenSeizureDetector!&lt;br/>
Please enable Data Sharing to help improve OpenSeizureDetector! (see below for details)&lt;br/>&lt;br/>
\nPlease subscribe to updates at
http://openseizuredetector.org.uk, or the app Facebook page at https://www.facebook.com/openseizuredetector. Please subscribe to updates at &lt;b>www.openseizuredetector.org.uk&lt;/b>
so I can get in touch if necessary.\nThank you! Graham \ngraham@openseizuredetector.org.uk so we can inform you of any issues.
\n\nChanges in this version: &lt;br/>&lt;br/>
\n &lt;b>Changes in this version:&lt;/b>&lt;br/>
</string> </string>
<string name="FirstRunDlgMsg"> <string name="FirstRunDlgMsg">
OpenSeizureDetector does not collect any personal data other than through the Data Sharing system that allows your seizure events to be analysed to improve detection reliability and false alarm rate (see https://www.openseizuredetector.org.uk/?page_id=1818) For details of how OpenSeizure Detector collects and uses
Please enable Data Sharing to help improve OpenSeizureDetector! your personal data, please refer to the &lt;b>Privacy Policy below&lt;/b>.&lt;br/>&lt;br/>
\nPlease subscribe to updates at
http://openseizuredetector.org.uk, or the app Facebook page at https://www.facebook.com/openseizuredetector. Please enable &lt;b>Data Sharing&lt;/b> to help improve OpenSeizureDetector!&lt;br/>
so I can get in touch if necessary.\nThank you! Graham \ngraham@openseizuredetector.org.uk (see below for details)&lt;br/>&lt;br/>
\n\nChanges in this version:
Please subscribe to updates at &lt;b>www.openseizuredetector.org.uk&lt;/b>
so we can inform you of any issues.
</string> </string>
<string name="ask_for_error_log">Sorry, OpenSeizureDetector Has Crashed. Please Email this log file to us so we can work out what happened and fix it.\nThanks, Graham.</string> <string name="ask_for_error_log">Sorry, OpenSeizureDetector Has Crashed. Please Email this log file to us so we can work out what happened and fix it.\nThanks, Graham.</string>
<string name="email_welcome_note">Dear OpenSeizureDetector,\n\nApplication is just crashed, please check following error log for more details.\n\n\n</string> <string name="email_welcome_note">Dear OpenSeizureDetector,\n\nApplication is just crashed, please check following error log for more details.\n\n\n</string>
<string name="copyright_info">OpenSeizureDetector (Using UCE Handler\nCopyright © 2018 Rohit Sahebrao Surwase.)</string> <string name="copyright_info">OpenSeizureDetector (Using UCE Handler\nCopyright © 2018 Rohit Sahebrao Surwase.)</string>
<string name="okBtnTxt">OK</string> <string name="okBtnTxt">OK</string>
<string name="closeBtnTxt">Close</string>
<string name="UpdateDialogTitleTxt">Thank you for Updating OpenSeizureDetector</string> <string name="UpdateDialogTitleTxt">Thank you for Updating OpenSeizureDetector</string>
<string name="FirstRunDlgTitle">Welcome to OpenSeizureDetector</string> <string name="FirstRunDlgTitle">Welcome to OpenSeizureDetector</string>
<string name="SmsPermissionWarning">Problem with SMS Permissions\n(please check phone settings -> Apps -> OpenSeizureDetector -> Permissions</string> <string name="SmsPermissionWarning">Problem with SMS Permissions\n(please check phone settings -> Apps -> OpenSeizureDetector -> Permissions</string>
@@ -137,28 +133,15 @@
associated with a seizure, associated with a seizure,
then raises audible and text then raises audible and text
message (SMS) location alerts for carers.\n\n message (SMS) location alerts for carers.\n\n
The system is free and open source - see \n The system is free and open source - see
http://openseizuredetector.org.uk for details. openseizuredetector.org.uk for details.\n\n
Please report any issues by raising an issue on the project github source code repository - https://github.com/OpenSeizureDetector/Android_Pebble_SD/issues Please report any issues by raising an issue on the source code repository - https://github.com/OpenSeizureDetector/Android_Pebble_SD/issues
or email graham@openseizuredetector.org.uk\n or email graham@openseizuredetector.org.uk\n\n
\n\n Android App and Garmin Watch App,
Please see the Privacy Policy (https://www.openseizuredetector.org.uk/?post=1415) for details of how OpenSeizureDetector uses and shares your data.
</string>
<string name="credits_text">
Main Watch App and Android App \n
copyright Graham Jones, 2015-2022.\n copyright Graham Jones, 2015-2022.\n
The following libraries are used:\n
- SYLT-FFT - https://github.com/stg/SYLT-FFT by D. Taylor.\n </string>
- NanoHTTPD - https://github.com/NanoHttpd/nanohttpd\n <string name="credits_text"></string>
- jQuery - http://jquery.org\n
- jBeep - http://www.ultraduz.com.br\n
- Chartjs - http://www.chartjs.org\n
- MPAndroidChart - https://github.com/PhilJay/MPAndroidChart\n
- UCE-Handler - https://github.com/RohitSurwase/UCE-Handler\n \n
The Logo is based on Star of life2 by Verdy P, \n
Licensed under Public Domain via\n
Wikimedia Commons (http://commons.wikimedia.org/wiki/File:Star_of_life2.svg#mediaviewer/File:Star_of_life2.svg).
</string>
<string name="edit_settings">Edit Settings</string> <string name="edit_settings">Edit Settings</string>
<string name="sms_location_alarm_active">SMS Location Alarm Active</string> <string name="sms_location_alarm_active">SMS Location Alarm Active</string>
<string name="sms_location_alarm_disabled">SMS Location Alarm Disabled</string> <string name="sms_location_alarm_disabled">SMS Location Alarm Disabled</string>