Converted Android_Pebble_SD to use Android Studio (Gradle) build system.
BIN
app/src/main/res/drawable/ic_action_settings.png
Normal file
|
After Width: | Height: | Size: 240 B |
BIN
app/src/main/res/drawable/icon_24x24.png
Normal file
|
After Width: | Height: | Size: 210 B |
BIN
app/src/main/res/drawable/star_of_life_24x24.png
Normal file
|
After Width: | Height: | Size: 210 B |
BIN
app/src/main/res/drawable/star_of_life_48x48.png
Normal file
|
After Width: | Height: | Size: 2.9 KiB |
BIN
app/src/main/res/drawable/start_server.png
Normal file
|
After Width: | Height: | Size: 310 B |
BIN
app/src/main/res/drawable/stat_sample.png
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
app/src/main/res/drawable/stop_server.png
Normal file
|
After Width: | Height: | Size: 252 B |
103
app/src/main/res/layout/main.xml
Normal file
@@ -0,0 +1,103 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:orientation="vertical"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent"
|
||||
>
|
||||
<TextView
|
||||
android:id="@+id/versionTv"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Android OpenSeizureDetector Version x.xx"
|
||||
/>
|
||||
|
||||
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:orientation="horizontal"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
>
|
||||
<TextView
|
||||
android:id="@+id/textView1"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="0.5"
|
||||
android:text="textView1"
|
||||
/>
|
||||
<TextView
|
||||
android:id="@+id/textView2"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="0.5"
|
||||
android:text="textView2"
|
||||
/>
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:orientation="horizontal"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:orientation="vertical"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="0.5"
|
||||
>
|
||||
<TextView
|
||||
android:id="@+id/alarmTv"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="alarmTv"
|
||||
android:textSize="32sp"
|
||||
/>
|
||||
<TextView
|
||||
android:id="@+id/pebTimeTv"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="pebTimeTv"
|
||||
/>
|
||||
</LinearLayout>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:orientation="vertical"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="0.5"
|
||||
>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/pebbleTv"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="pebbleTv"
|
||||
/>
|
||||
<TextView
|
||||
android:id="@+id/appTv"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="appTv"
|
||||
/>
|
||||
<TextView
|
||||
android:id="@+id/battTv"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="battTv"
|
||||
/>
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/debugTv"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="battTv"
|
||||
/>
|
||||
|
||||
<com.github.mikephil.charting.charts.LineChart
|
||||
android:id="@+id/chart1"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_above="@+id/seekBar1" />
|
||||
</LinearLayout>
|
||||
|
||||
52
app/src/main/res/menu/main_activity_actions.xml
Normal file
@@ -0,0 +1,52 @@
|
||||
<menu xmlns:android="http://schemas.android.com/apk/res/android" >
|
||||
<item android:id="@+id/action_launch_pebble_app"
|
||||
android:icon="@drawable/stop_server"
|
||||
android:title="Launch Pebble App"
|
||||
android:showAsAction="never|withText"
|
||||
/>
|
||||
|
||||
<item android:id="@+id/action_start_stop"
|
||||
android:icon="@drawable/stop_server"
|
||||
android:title="Stop Server"
|
||||
android:showAsAction="never|withText"
|
||||
/>
|
||||
|
||||
<item android:id="@+id/action_test_fault_beep"
|
||||
android:icon="@drawable/stop_server"
|
||||
android:title="Test Fault Beep"
|
||||
android:showAsAction="never|withText"
|
||||
/>
|
||||
|
||||
<item android:id="@+id/action_test_alarm_beep"
|
||||
android:icon="@drawable/stop_server"
|
||||
android:title="Test Alarm Beep"
|
||||
android:showAsAction="never|withText"
|
||||
/>
|
||||
|
||||
<item android:id="@+id/action_test_warning_beep"
|
||||
android:icon="@drawable/stop_server"
|
||||
android:title="Test Warning Beep"
|
||||
android:showAsAction="never|withText"
|
||||
/>
|
||||
|
||||
<item android:id="@+id/action_test_sms_alarm"
|
||||
android:icon="@drawable/stop_server"
|
||||
android:title="Test SMS Alarm Notification"
|
||||
android:showAsAction="never|withText"
|
||||
/>
|
||||
|
||||
|
||||
<item android:id="@+id/action_settings"
|
||||
android:icon="@drawable/ic_action_settings"
|
||||
android:title="Settings"
|
||||
android:showAsAction="never|withText"
|
||||
/>
|
||||
|
||||
<!--
|
||||
<item android:id="@+id/action_watch_settings"
|
||||
android:icon="@drawable/ic_action_settings"
|
||||
android:title="Watch Settings"
|
||||
android:showAsAction="never|withText"
|
||||
/>
|
||||
-->
|
||||
</menu>
|
||||
4
app/src/main/res/values/strings.xml
Normal file
@@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<string name="app_name">OpenSeizureDetector Server</string>
|
||||
</resources>
|
||||
101
app/src/main/res/xml/prefs.xml
Normal file
@@ -0,0 +1,101 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<CheckBoxPreference
|
||||
android:key="AudibleAlarm"
|
||||
android:title="Enable Audible Alarm"
|
||||
android:summary="Issue an audible alarm if the seizure detector enters an alarm condition."
|
||||
android:defaultValue="true" />
|
||||
<CheckBoxPreference
|
||||
android:key="AudibleWarning"
|
||||
android:title="Enable Audible Warnings"
|
||||
android:summary="Issue an audible alarm if the seizure detector enters a warning (pre-alarm) condition."
|
||||
android:defaultValue="true" />
|
||||
<CheckBoxPreference
|
||||
android:key="SMSAlarm"
|
||||
android:title="Enable SMS Alarm"
|
||||
android:summary="Issue a SMS (Text Message) alarm if the seizure detector enters an alarm condition."
|
||||
android:defaultValue="false" />
|
||||
<EditTextPreference
|
||||
android:key="SMSNumbers"
|
||||
android:title="SMS Alarm numbers"
|
||||
android:summary="Telephone number(s) to notify by SMS of Alarm (comma separated)."
|
||||
android:defaultValue="" />
|
||||
<EditTextPreference
|
||||
android:key="SMSMsg"
|
||||
android:title="SMS Message"
|
||||
android:summary="Message to be Sent by SMS when a Seizure is Detected."
|
||||
android:defaultValue="**SEIZURE DETECTED**" />
|
||||
|
||||
<CheckBoxPreference
|
||||
android:key="AudibleFaultWarning"
|
||||
android:title="Enable Audible System FaultWarnings"
|
||||
android:summary="Issue an audible alarm if the system detects a fault (e.g. can not talk to Pebble)."
|
||||
android:defaultValue="true" />
|
||||
|
||||
<CheckBoxPreference
|
||||
android:key="LogAlarms"
|
||||
android:title="Log Alarm events to SD Card"
|
||||
android:summary="Log Alarm events to SD Card"
|
||||
android:defaultValue="true" />
|
||||
<CheckBoxPreference
|
||||
android:key="LogData"
|
||||
android:title="Log Data to SD Card"
|
||||
android:summary="Log Data to SD Card Regularly"
|
||||
android:defaultValue="false" />
|
||||
<!-- <CheckBoxPreference
|
||||
android:key="PreventSleep"
|
||||
android:title="Prevent the screen from blanking."
|
||||
android:summary="Prevent the screen from blanking while the application is running."
|
||||
android:defaultValue="false" />
|
||||
<EditTextPreference
|
||||
android:key="UpdatePeriod"
|
||||
android:title="Display Update Period (ms)."
|
||||
android:summary="Display update period in miliseconds."
|
||||
android:defaultValue="1000" />
|
||||
-->
|
||||
<EditTextPreference
|
||||
android:key="AlarmFreqMin"
|
||||
android:title="AlarmFreqMin (Hz)"
|
||||
android:summary="Minimum Frequency of ROI (Hz) (Default = 5 Hz)"
|
||||
android:defaultValue="5" />
|
||||
<EditTextPreference
|
||||
android:key="AlarmFreqMax"
|
||||
android:title="AlarmFreqMax (Hz)"
|
||||
android:summary="Maximum Frequency of ROI (Hz) (Default = 10 Hz)"
|
||||
android:defaultValue="10" />
|
||||
<EditTextPreference
|
||||
android:key="WarnTime"
|
||||
android:title="WarnTime (sec)"
|
||||
android:summary="Time to wait before initiating warning (Default = 5 sec)"
|
||||
android:defaultValue="5" />
|
||||
<EditTextPreference
|
||||
android:key="AlarmTime"
|
||||
android:title="AlarmTime (sec)"
|
||||
android:summary="Time to wait before initiating alarm (Default = 10 sec)"
|
||||
android:defaultValue="10" />
|
||||
<EditTextPreference
|
||||
android:key="AlarmThresh"
|
||||
android:title="AlarmThresh"
|
||||
android:summary="Alarm Threshold (Default = 100)"
|
||||
android:defaultValue="100" />
|
||||
<EditTextPreference
|
||||
android:key="AlarmRatioThresh"
|
||||
android:title="AlarmRatioThresh"
|
||||
android:summary="Alarm Ratio Threshold (Default = 30)"
|
||||
android:defaultValue="30" />
|
||||
|
||||
|
||||
<EditTextPreference
|
||||
android:key="AppRestartTimeout"
|
||||
android:title="Period (sec) we wait for data before restarting watch app."
|
||||
android:summary="Period (seconds) that we wait for data from the watch before assuming the watch app is not running and re-starting it."
|
||||
android:numeric="integer"
|
||||
android:defaultValue="10" />
|
||||
<EditTextPreference
|
||||
android:key="FaultTimerPeriod"
|
||||
android:title="Fault Timer Duration (sec)"
|
||||
android:summary="Duration that fault alarms are muted before initiating."
|
||||
android:numeric="integer"
|
||||
android:defaultValue="30" />
|
||||
|
||||
</PreferenceScreen>
|
||||