Back to project page rock-paper-scissors.
The source code is released under:
MIT License
If you think the Android project rock-paper-scissors listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package au.com.codeka.rps; /* w ww. j a va 2 s.co m*/ import com.google.android.gms.wearable.MessageEvent; import com.google.android.gms.wearable.WearableListenerService; import java.io.UnsupportedEncodingException; import au.com.codeka.rps.game.StateManager; /** * This service listens for messages back from the watch. */ public class MessageListenerService extends WearableListenerService { @Override public void onMessageReceived(MessageEvent msgEvent) { String payload = null; if (msgEvent.getData() != null) { try { payload = new String(msgEvent.getData(), "utf-8"); } catch (UnsupportedEncodingException e) { } } StateManager.i.onMessageReceived(msgEvent.getPath(), payload); } }