Back to project page AndroidFortunes.
The source code is released under:
Apache License
If you think the Android project AndroidFortunes 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 org.codechimp.androidfortunes; /*w w w. ja v a 2s . c o m*/ import android.util.Log; import com.google.android.gms.wearable.MessageEvent; import com.google.android.gms.wearable.WearableListenerService; public class MobileListenerService extends WearableListenerService { private static final String TAG = "MobileListenerService"; private static final String MSG_QUOTEREQUEST = "/quoterequest"; @Override public void onCreate() { super.onCreate(); } @Override public void onDestroy() { super.onDestroy(); } @Override public void onMessageReceived(MessageEvent messageEvent) { String path = messageEvent.getPath(); if (path.equals(MSG_QUOTEREQUEST)) { Log.d(TAG, "Quote Request Received"); Quote q; q = CloudyFortunesClient.getCloudyFortunesApiClient().randomQuote(); NotifyHelper.sendMessageToWear(this.getBaseContext(), q.getContent()); } } }