Android Open Source - android-wear-go-walk Wear Service






From Project

Back to project page android-wear-go-walk.

License

The source code is released under:

MIT License

If you think the Android project android-wear-go-walk listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.beltranfebrer.gowalk2;
/* w  w w. jav a2s  . c  om*/
import android.content.Intent;
import android.util.Log;

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

public class WearService extends WearableListenerService  implements MessageApi.MessageListener {

    private static final String ASK_STEPS = "/ask/Steps";
    private static final String TAG = WearService.class.toString();

    public WearService() {
        Log.d(TAG, "Service Created");
    }

    @Override
    public void onMessageReceived(MessageEvent messageEvent) {
        Log.d(TAG, "onMessageReceived");
        if (messageEvent.getPath().equals(ASK_STEPS)) {
            new StepChecker(this);


        }
    }
}




Java Source Code List

com.beltranfebrer.gowalk2.ApplicationTest.java
com.beltranfebrer.gowalk2.BootCompletedIntentReceiver.java
com.beltranfebrer.gowalk2.MainActivity.java
com.beltranfebrer.gowalk2.StepChecker.java
com.beltranfebrer.gowalk2.WearActivity.java
com.beltranfebrer.gowalk2.WearService.java