Android Open Source - RxWatchFace Listener Service






From Project

Back to project page RxWatchFace.

License

The source code is released under:

Apache License

If you think the Android project RxWatchFace 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.colintheshots.rxwatchface;
//from  w  w  w.ja  v a 2 s  . c  o  m
import android.content.Intent;
import android.support.v4.content.LocalBroadcastManager;

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

/**
 * Created by colin.lee on 11/2/14.
 */
public class ListenerService extends WearableListenerService {

    private static final String TAG = "ListenerService";
    public static final String MESSAGE_PATH = "/message";

    @Override
    public void onMessageReceived(MessageEvent messageEvent) {

        if (messageEvent.getPath().equals(MESSAGE_PATH)) {
            final String message = new String(messageEvent.getData());

            // Broadcast message to wearable activity for display
            Intent messageIntent = new Intent();
            messageIntent.setAction(Intent.ACTION_SEND);
            messageIntent.putExtra("message", message);
            LocalBroadcastManager.getInstance(this).sendBroadcast(messageIntent);
        } else {
            super.onMessageReceived(messageEvent);
        }
    }
}




Java Source Code List

com.colintheshots.rxwatchface.GithubClient.java
com.colintheshots.rxwatchface.ListenerService.java
com.colintheshots.rxwatchface.MainActivity.java
com.colintheshots.rxwatchface.WatchfaceApp.java
com.colintheshots.rxwatchface.activity.WatchfaceActivity.java
com.colintheshots.rxwatchface.models.GistDetail.java
com.colintheshots.rxwatchface.models.GistFile.java
com.colintheshots.rxwatchface.models.Gist.java
com.colintheshots.rxwatchface.widget.Watchface.java