Added autostart on boot feature
This commit is contained in:
@@ -1,6 +1,9 @@
|
|||||||
OpenSeizureDetector Android App - Change Log
|
OpenSeizureDetector Android App - Change Log
|
||||||
============================================
|
============================================
|
||||||
|
|
||||||
|
V2.3.0 - 14 Dec 2016
|
||||||
|
- Added auto start on phone boot feature (selectable from general settings)
|
||||||
|
|
||||||
V2.0.8 - 24 Aug 2016
|
V2.0.8 - 24 Aug 2016
|
||||||
- Added checks for correct version of pebble watch app for compatibility with this
|
- Added checks for correct version of pebble watch app for compatibility with this
|
||||||
Android App.
|
Android App.
|
||||||
|
|||||||
@@ -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="30"
|
android:versionCode="31"
|
||||||
android:versionName="2.0.9">
|
android:versionName="2.3.0">
|
||||||
|
|
||||||
<uses-sdk android:minSdkVersion="14" />
|
<uses-sdk android:minSdkVersion="14" />
|
||||||
|
|
||||||
@@ -18,8 +18,10 @@
|
|||||||
android:name="android.hardware.telephony"
|
android:name="android.hardware.telephony"
|
||||||
android:required="false" />
|
android:required="false" />
|
||||||
|
|
||||||
<android:uses-permission android:name="android.permission.READ_PHONE_STATE" />
|
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
|
||||||
<android:uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
|
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
|
||||||
|
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
|
||||||
|
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
|
||||||
|
|
||||||
<application
|
<application
|
||||||
android:icon="@drawable/star_of_life_48x48"
|
android:icon="@drawable/star_of_life_48x48"
|
||||||
@@ -45,6 +47,18 @@
|
|||||||
android:exported="false" />
|
android:exported="false" />
|
||||||
|
|
||||||
<activity android:name=".LogManagerActivity"></activity>
|
<activity android:name=".LogManagerActivity"></activity>
|
||||||
|
|
||||||
|
<receiver
|
||||||
|
android:name=".BootBroadcastReceiver"
|
||||||
|
android:label="BootBroadcastReceiver">
|
||||||
|
<intent-filter>
|
||||||
|
<action android:name="android.intent.action.BOOT_COMPLETED" />
|
||||||
|
</intent-filter>
|
||||||
|
</receiver>
|
||||||
|
|
||||||
|
|
||||||
</application>
|
</application>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</manifest> <!-- android:uiOptions="splitActionBarWhenNarrow" -->
|
</manifest> <!-- android:uiOptions="splitActionBarWhenNarrow" -->
|
||||||
|
|||||||
@@ -0,0 +1,31 @@
|
|||||||
|
package uk.org.openseizuredetector;
|
||||||
|
|
||||||
|
import android.content.BroadcastReceiver;
|
||||||
|
import android.content.Context;
|
||||||
|
import android.content.Intent;
|
||||||
|
import android.content.SharedPreferences;
|
||||||
|
import android.preference.PreferenceManager;
|
||||||
|
import android.util.Log;
|
||||||
|
import android.widget.Toast;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by graham on 14/12/16.
|
||||||
|
*/
|
||||||
|
|
||||||
|
public class BootBroadcastReceiver extends BroadcastReceiver {
|
||||||
|
private String TAG = "BroadcastReceiver";
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onReceive(Context context, Intent intent) {
|
||||||
|
Log.v(TAG, "onReceive()");
|
||||||
|
SharedPreferences SP = PreferenceManager
|
||||||
|
.getDefaultSharedPreferences(context);
|
||||||
|
boolean autoStart = SP.getBoolean("AutoStart",false);
|
||||||
|
Log.v(TAG,"onReceive() - autoStart = "+autoStart);
|
||||||
|
if (autoStart && Intent.ACTION_BOOT_COMPLETED.equals(intent.getAction())) {
|
||||||
|
Intent startUpIntent = new Intent(context, StartupActivity.class);
|
||||||
|
startUpIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||||
|
context.startActivity(startUpIntent);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -28,6 +28,13 @@
|
|||||||
android:key="UpdatePeriod"
|
android:key="UpdatePeriod"
|
||||||
android:summary="Display update period in miliseconds."
|
android:summary="Display update period in miliseconds."
|
||||||
android:title="Display Update Period (ms)." />
|
android:title="Display Update Period (ms)." />
|
||||||
|
<CheckBoxPreference
|
||||||
|
android:defaultValue="false"
|
||||||
|
android:key="AutoStart"
|
||||||
|
android:summary="Auto Start App on Boot"
|
||||||
|
android:title="Auto Start App on Boot"
|
||||||
|
android:enabled="true"
|
||||||
|
/>
|
||||||
<CheckBoxPreference
|
<CheckBoxPreference
|
||||||
android:defaultValue="false"
|
android:defaultValue="false"
|
||||||
android:key="UseIpCamera"
|
android:key="UseIpCamera"
|
||||||
|
|||||||
Reference in New Issue
Block a user