I am trying to transfer heart rate sensors data from watch to mobile device. On the watch(wearable) side, I am getting message stating that the data has been transferred. I have set the priority of the message(PutDataMapRequest) as urgent on the watch.
However, I am unable to receive the data on the mobile device. Following is my code for AndroidManifest.xml:
<%service android:name=".WearableListenerService1">
<%intent-filter>
<%action android:name="com.google.android.gms.wearable.DATA_CHANGED" />
<%data android:host="*" android:scheme="wear" android:pathPrefix= "/healthcare" />
</intent-filter>
</service>
My WearableListenerService1 class is:
public class WearableListenerService1 extends WearableListenerService {
@Override
public void onMessageReceived(MessageEvent messageEvent) {
super.onMessageReceived(messageEvent);
String event = messageEvent.getPath();
Log.d("Event ", event);
String [] message = event.split("--");
Intent i = new Intent(this, MainActivity.class);
startActivity(i);
}
@Override
public void onDataChanged(DataEventBuffer dataEventBuffer) {
// super.onDataChanged(dataEventBuffer);
Log.d("Event ", "event data changed");
Intent i = new Intent(this, MainActivity.class);
startActivity(i);
}
}
I am using following libraries:
compile 'com.google.android.support:wearable:2.0.0-alpha2'
compile 'com.google.android.gms:play-services-wearable:9.4.0'