Can't reinstall crashed Sony SmartWatch Control
Asked Answered
C

2

6

I hope this is not to generic but I am developing an app for the Sony SmartWatch. When ever I make a mistake like allowing a null pointer exception. I can not get my app to restart. It's like it stays in the crashed state forever. To make the problem worse I also stop receiving messages via Logcat pertaining the app. When I uninstall and reinstall the app It's not listed in the SmartWatch app on the phone. Like it won't register. This is difficult to trouble shoot since I don't get any Log messages at this point. The only thing I can do is uninstall the app. Restart my phone. Then reinstall the app. At that point it's back to normal and I can start writing code again. So that brings me to my questions. Is there a better way to re-register a control? Will this happen to end users? If the app crashes will they need to uninstall, reboot and install to recover?

Some Detail (names have been changed to protect the inocent):

I have created a Broadcast Reciever and in my mainfest set it to listen for these broadcasts.

  <receiver android:name=".MyExtensionReceiver" >
        <intent-filter>
             <!-- Receiver intents -->
            <action android:name="com.sonyericsson.extras.liveware.aef.registration.EXTENSION_REGISTER_REQUEST" />
            <action android:name="com.sonyericsson.extras.liveware.aef.registration.ACCESSORY_CONNECTION" />

            <!-- Control intents -->
            <action android:name="com.sonyericsson.extras.aef.control.START" />
            <action android:name="com.sonyericsson.extras.aef.control.STOP" />
            <action android:name="com.sonyericsson.extras.aef.control.PAUSE" />
            <action android:name="com.sonyericsson.extras.aef.control.RESUME" />
            <action android:name="com.sonyericsson.extras.aef.control.ERROR" />
            <action android:name="com.sonyericsson.extras.aef.control.TOUCH_EVENT" />
            <action android:name="com.sonyericsson.extras.aef.control.SWIPE_EVENT" />

        </intent-filter>

Code for MyExtensionReceiver:

 public class MyExtensionReceiver extends BroadcastReceiver {


public MyExtensionReceiver() {
    super();
    Log.d("mytag", "MyExtensionReceiver Loaded");
    Dbg.setLogTag("mytag");
}

@Override
public void onReceive(Context context, Intent intent) {
    Log.d("mytag", "onReceive: " + intent.getAction());
    intent.setClass(context, MyExtensionReceiver.class);
    context.startService(intent);
}

}

Even if my app is crashing I should still get a log message when onReceive is called. It's like the EXTENSION_REGISTER_REQUEST broadcast never gets sent. I just keep uninstalling rebooting and reinstalling over and over. Eventually the app gets found by the SmartConnect App.

Crin answered 30/1, 2013 at 20:19 Comment(1)
I do remember some similar sorts of issues. Don't remember the details now though it was 6 months back.Brochure
L
0

It doesn't seem to have anything to do with the BroadcastReceiver. Without using one, I'm having the same annoying problem. I need to restart the phone in order to get things running normal again, as neither disabling/enabling the app helps a bit, nor killing the SmartWatch phone app (as I see no other way to restart it).

I would also appreciate some help from Sony on this matter.

Loan answered 10/2, 2013 at 18:32 Comment(0)
S
0

Just came across this issue, giving some grey!! To work around this issue, just create a new intent using string and launch that with context.

Intent intent = new Intent("MY.PACKAGE.NAME.MyExtensionReceiver");
context.startService(intent);
Spireme answered 10/10, 2013 at 22:22 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.