Skip to content

Commit 9892aa4

Browse files
committed
V4.2.12 - added buttons and menu items for 'Help' and 'Troubleshooting' to point users to the web site instructions.
1 parent d2c1cb0 commit 9892aa4

10 files changed

+133
-9
lines changed

CHANGELOG.md

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
OpenSeizureDetector Android App - Change Log
22
============================================
3+
V4.2.12 - Fixed crash when pressing 'Install Watch App' button by hiding the button if the Pebble data source is not selected
4+
- Added a 'Help' and 'Troubleshooting' button and menu item to draw users' attention to the web site instructions.
35
V4.2.11 - Updated permissions handling to support Android 14 (needed to publish on Play Store)
46
- added a crude 'flap' detector into OSD Algorithm
57
- Added setting to change the delay before SMS alert is sent (Issue #202)

app/src/main/AndroidManifest.xml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
33
xmlns:tools="http://schemas.android.com/tools"
4-
android:versionCode="150"
5-
android:versionName="4.2.11">
4+
android:versionCode="151"
5+
android:versionName="4.2.12">
66
<!-- android:allowBackup="false" -->
77
<uses-permission android:name="android.permission.POST_NOTIFICATIONS"/>
88

app/src/main/java/uk/org/openseizuredetector/MainActivity2.java

+28
Original file line numberDiff line numberDiff line change
@@ -292,6 +292,34 @@ public void run() {
292292
Log.i(TAG, "exception starting settings activity " + ex.toString());
293293
}
294294
return true;
295+
case R.id.action_instructions:
296+
Log.i(TAG, "action_instructions");
297+
try {
298+
String url = "https://www.openseizuredetector.org.uk/?page_id=1894";
299+
Intent i = new Intent(Intent.ACTION_VIEW);
300+
i.setData(Uri.parse(url));
301+
i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
302+
startActivity(i);
303+
} catch (Exception ex) {
304+
Log.v(TAG, "exception displaying instructions " + ex.toString());
305+
mUtil.showToast("ERROR Displaying Instructions");
306+
}
307+
return true;
308+
309+
case R.id.action_troubleshooting:
310+
Log.i(TAG, "action_troubleshooting");
311+
try {
312+
String url = "https://www.openseizuredetector.org.uk/?page_id=2235";
313+
Intent i = new Intent(Intent.ACTION_VIEW);
314+
i.setData(Uri.parse(url));
315+
i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
316+
startActivity(i);
317+
} catch (Exception ex) {
318+
Log.v(TAG, "exception displaying troubleshooting " + ex.toString());
319+
mUtil.showToast("ERROR Displaying Troubleshooting Tips");
320+
}
321+
return true;
322+
295323
case R.id.action_about:
296324
Log.i(TAG, "action_about");
297325
showAbout();

app/src/main/java/uk/org/openseizuredetector/StartupActivity.java

+66-4
Original file line numberDiff line numberDiff line change
@@ -183,17 +183,79 @@ public void onClick(View view) {
183183
}
184184
});
185185

186-
186+
// Enable the "Install Watch App" button if we have the Pebble data source selected,
187+
// otherwise hide it.
187188
b = (Button) findViewById(R.id.installOsdAppButton);
189+
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);
190+
String dataSourceName = (prefs.getString("DataSource", "Phone"));
191+
if (dataSourceName.equals("Pebble")) {
192+
b.setOnClickListener(new View.OnClickListener() {
193+
@Override
194+
public void onClick(View view) {
195+
Log.v(TAG, "install Osd Watch App button clicked");
196+
if (mConnection.mSdServer.mSdDataSource != null) {
197+
mUtil.writeToSysLogFile("Installing Watch App");
198+
mConnection.mSdServer.mSdDataSource.installWatchApp();
199+
} else {
200+
mUtil.showToast("Error installing watch app - Datasource has not started - please see installation instructions on web site");
201+
Log.v(TAG, "Displaying Installation Instructions");
202+
try {
203+
String url = "https://www.openseizuredetector.org.uk/?page_id=1894";
204+
Intent i = new Intent(Intent.ACTION_VIEW);
205+
i.setData(Uri.parse(url));
206+
i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
207+
startActivity(i);
208+
} catch (Exception ex) {
209+
Log.i(TAG, "exception starting install watch app activity " + ex.toString());
210+
mUtil.showToast("Error Displaying Installation Instructions - try http://www.openseizuredetector.org.uk/?page_id=1894 instead");
211+
}
212+
}
213+
}
214+
});
215+
} else {
216+
b.setVisibility(View.GONE);
217+
}
218+
219+
b = (Button) findViewById(R.id.instructionsButton);
220+
b.setOnClickListener(new View.OnClickListener() {
221+
@Override
222+
public void onClick(View view) {
223+
Log.v(TAG, "instructions button clicked");
224+
try {
225+
String url = "https://www.openseizuredetector.org.uk/?page_id=1894";
226+
Intent i = new Intent(Intent.ACTION_VIEW);
227+
i.setData(Uri.parse(url));
228+
i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
229+
startActivity(i);
230+
} catch (Exception ex) {
231+
Log.v(TAG, "exception displaying instructions " + ex.toString());
232+
mUtil.showToast("ERROR Displaying Instructions");
233+
}
234+
235+
}
236+
});
237+
238+
b = (Button) findViewById(R.id.troubleshootingButton);
188239
b.setOnClickListener(new View.OnClickListener() {
189240
@Override
190241
public void onClick(View view) {
191-
Log.v(TAG, "install Osd Watch App button clicked");
192-
mUtil.writeToSysLogFile("Installing Watch App");
193-
mConnection.mSdServer.mSdDataSource.installWatchApp();
242+
Log.v(TAG, "troubleshooting button clicked");
243+
try {
244+
String url = "https://www.openseizuredetector.org.uk/?page_id=2235";
245+
Intent i = new Intent(Intent.ACTION_VIEW);
246+
i.setData(Uri.parse(url));
247+
i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
248+
startActivity(i);
249+
} catch (Exception ex) {
250+
Log.v(TAG, "exception displaying troubleshooting " + ex.toString());
251+
mUtil.showToast("ERROR Displaying Troubleshooting Tips");
252+
}
253+
194254
}
195255
});
196256

257+
258+
// Connect to the background service
197259
mConnection = new SdServiceConnection(getApplicationContext());
198260

199261
}

app/src/main/res/layout/startup_activity.xml

+26-2
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,36 @@
3535
android:layout_gravity="center_horizontal" />
3636

3737
<LinearLayout
38-
android:orientation="vertical"
38+
android:orientation="horizontal"
3939
android:layout_width="match_parent"
4040
android:layout_height="wrap_content">
41+
42+
<Button
43+
android:layout_width="0dp"
44+
android:layout_weight="1"
45+
android:layout_height="wrap_content"
46+
android:layout_marginLeft="5dp"
47+
android:layout_marginRight="5dp"
48+
android:text="Help"
49+
android:id="@+id/instructionsButton"
50+
android:layout_gravity="center_horizontal" />
51+
52+
<Button
53+
android:layout_width="0dp"
54+
android:layout_weight="1"
55+
android:layout_height="wrap_content"
56+
android:layout_marginLeft="5dp"
57+
android:layout_marginRight="5dp"
58+
android:text="Trouble-\nshooting"
59+
android:id="@+id/troubleshootingButton"
60+
android:layout_gravity="center_horizontal" />
61+
4162
<Button
42-
android:layout_width="wrap_content"
63+
android:layout_width="0dp"
64+
android:layout_weight="1"
4365
android:layout_height="wrap_content"
66+
android:layout_marginLeft="5dp"
67+
android:layout_marginRight="5dp"
4468
android:text="@string/edit_settings"
4569
android:id="@+id/settingsButton"
4670
android:layout_gravity="center_horizontal" />

app/src/main/res/menu/main_activity_actions.xml

+8
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,14 @@
105105

106106
<group android:id="@+id/grp6">
107107

108+
<item
109+
android:id="@+id/action_instructions"
110+
app:showAsAction="never|withText"
111+
android:title="Help" />
112+
<item
113+
android:id="@+id/action_troubleshooting"
114+
app:showAsAction="never|withText"
115+
android:title="Troubleshooting" />
108116
<item
109117
android:id="@+id/action_about"
110118
app:showAsAction="never|withText"

app/src/main/res/values/strings.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<string name="app_name">OpenSeizureDetector</string>
44
<string name="changelog">
55
"\n
6-
\nV4.2.11 - Reduced data usage of Data Sharing system, and added a 'flap detector' component to detect high amplitude, low frequency movement
6+
\nV4.2.12 - Added butons and menu items for 'Help' and 'Troubleshooting' to point users to the web page instructoins.
77
\nV4.2 - Added support for PineTime and BangleJS Watches using Bluetooth data source.
88
\n - Added support for Version 2 of the Garmin watch app, which reduces battery drain
99
\n - Added new, swipeable user interface to simplify the main screen.

releases/app-release-4.2.11b.apk

-14.5 MB
Binary file not shown.

releases/app-release-4.2.11d.apk

-14.5 MB
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)