Added code to stop watch app before starting it to try to improve reliability of app start.

This commit is contained in:
Graham Jones
2016-07-19 22:25:06 +01:00
parent 51c277f691
commit d44ec7c489
4 changed files with 17 additions and 7 deletions

View File

@@ -2,7 +2,7 @@
<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="24" android:versionCode="24"
android:versionName="2.0.3" > android:versionName="2.0.3a" >
<uses-sdk android:minSdkVersion="14" /> <uses-sdk android:minSdkVersion="14" />

View File

@@ -401,9 +401,18 @@ public class SdDataSourcePebble extends SdDataSource {
* Attempt to start the pebble_sd watch app on the pebble watch. * Attempt to start the pebble_sd watch app on the pebble watch.
*/ */
public void startWatchApp() { public void startWatchApp() {
Log.v(TAG, "startWatchApp()"); Log.v(TAG, "startWatchApp() - closing app first");
PebbleKit.startAppOnPebble(mContext, SD_UUID); // first close the watch app if it is running.
PebbleKit.closeAppOnPebble(mContext, SD_UUID);
// then start it after a 1 second delay.
final Handler handler = new Handler();
handler.postDelayed(new Runnable() {
@Override
public void run() {
Log.v(TAG, "startWatchApp() - starting watch app...");
PebbleKit.startAppOnPebble(mContext, SD_UUID);
}
}, 1000);
} }
/** /**

View File

@@ -4,7 +4,7 @@ buildscript {
jcenter() jcenter()
} }
dependencies { dependencies {
classpath 'com.android.tools.build:gradle:2.0.0' classpath 'com.android.tools.build:gradle:2.1.2'
} }
} }
allprojects { allprojects {

View File

@@ -7,5 +7,6 @@
# Location of the SDK. This is only used by Gradle. # Location of the SDK. This is only used by Gradle.
# For customization when using a Version Control System, please read the # For customization when using a Version Control System, please read the
# header note. # header note.
#Sat Apr 23 18:39:21 BST 2016 #Tue Jul 19 22:15:48 BST 2016
sdk.dir=/home/graham/Android/Sdk ndk.dir=/usr/local/android-sdk-linux/ndk-bundle
sdk.dir=/usr/local/android-sdk-linux