listener - Inconsistent peer connection between Android Phone and Watch -
i want add watch module existing android project. line in phone project androidmanifest:
<application android:name="com.xxx.xx.core.xx" android:icon="@drawable/launcher_icon" android:label="@string/app_name"> <receiver android:name="com.google.android.gcm.gcmbroadcastreceiver" android:permission="com.google.android.c2dm.permission.send"> <intent-filter> <action android:name="com.google.android.c2dm.intent.receive" /> <action android:name="com.google.android.c2dm.intent.registration" /> <category android:name="com.xx.xx" /> </intent-filter> </receiver> ....
this onpeerconnected method:
@override public void onpeerconnected(node peer) { super.onpeerconnected(peer); toast.maketext(this, "peer connected phone", toast.length_long).show(); }
i introduced problem. connection done sometime. see "peer connected phone" toast. however, when deploy new versions phone , watch, connection fails , dont see toast message. ideas ?
note: both have same package name in own androidmanifest files
onpeerconnected
called, if connection state changes. if app gets reinstalled, arrives in state , since there no change, not trigger callback. need explicitly check connection state using nodeapi.getconnectednodes
.
Comments
Post a Comment