package net.formula97.miragewatch;

import com.google.android.gms.wearable.MessageEvent;
import com.google.android.gms.wearable.WearableListenerService;

/**
 * Created by HAJIME on 2016/01/04.
 */
public class HandheldBattLevelReceiverService extends WearableListenerService {
    @Override
    public void onMessageReceived(MessageEvent messageEvent) {
        super.onMessageReceived(messageEvent);

        if (messageEvent.getPath().equals("/BatteryLevel")) {
            String s = new String(messageEvent.getData());

            MyWearApplication app = (MyWearApplication) getApplication();
            try {
                app.setBatteryLevel(Integer.parseInt(s));
            } catch (NumberFormatException e) {
                e.printStackTrace();
            }
        }
    }
}

@@ -29,16 +29,42 @@
 watch;%0A%0A
+import android.util.Log;%0A%0A
 import c
@@ -540,24 +540,100 @@
 etData());%0A%0A
+            Log.d(this.getClass().getSimpleName(), %22%E5%8F%97%E4%BF%A1%E3%81%97%E3%81%9F%E3%83%90%E3%83%83%E3%83%86%E3%83%AA%E3%83%BC%E3%83%AC%E3%83%99%E3%83%AB = %22 + s);%0A%0A
             

デバッグ用のコンソール出力を追加。