package com.metroveu.metroveu;

import android.app.Service;
import android.content.Intent;
import android.os.IBinder;
import android.util.Log;

import com.google.android.gms.wearable.DataEvent;
import com.google.android.gms.wearable.DataEventBuffer;
import com.google.android.gms.wearable.DataMap;
import com.google.android.gms.wearable.DataMapItem;
import com.google.android.gms.wearable.WearableListenerService;

public class WearConnector extends WearableListenerService {

    @Override
    public void onDataChanged(DataEventBuffer dataEvents) {
        for (DataEvent dataEvent : dataEvents) {
            if (dataEvent.getType() == DataEvent.TYPE_CHANGED) {
                DataMap dataMap = DataMapItem.fromDataItem(dataEvent.getDataItem()).getDataMap();
                String path = dataEvent.getDataItem().getUri().getPath();
                if (path.equals("/lines")) {
                    int number = dataMap.getInt("number");
                    Log.v("wear", Integer.toString(number));
                }
            }
        }
    }
}

@@ -29,94 +29,8 @@
 u;%0A%0A
-import android.app.Service;%0Aimport android.content.Intent;%0Aimport android.os.IBinder;%0A
 impo
@@ -50,16 +50,16 @@
 il.Log;%0A
+
 %0Aimport 
@@ -257,16 +257,69 @@
 apItem;%0A
+import com.google.android.gms.wearable.MessageEvent;%0A
 import c
@@ -437,16 +437,443 @@
 vice %7B%0A%0A
+    public void onMessageReceived(MessageEvent messageEvent) %7B%0A        System.out.println(%22Message Received on Phone on launch of wear homepage%22);%0A        if(messageEvent.getPath().equals(%22/lines%22)) %7B%0A            //sendSavedDeals(); //fetch from db and make a datamap object using PutDataRequest%0A            Log.v(%22JOAN%22, %22Message received%22);%0A        %7D%0A        else %7B%0A            Log.v(%22JOAN%22, %22Wrong path%22);%0A        %7D%0A%0A    %7D%0A%0A
     @Ove
@@ -1355,20 +1355,20 @@
  Log.v(%22
-wear
+JOAN
 %22, Integ

Change WeareableListener tag and implement onMessageReceived