Receiving messages using MessageAPI
In our previous section, we looked at how we can use MessageAPI
to send messages to the Android wearable. In this section, we will take a look at how we can retrieve this message and display it on our Android wearable device:
From the Project Navigator window, open the
WearActivity.java
file:Next, add the following highlighted
import
statements in theWearActivity.java
file:import android.app.Activity; import android.os.Bundle; import android.support.wearable.view.WatchViewStub; import android.widget.TextView; import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.os.Handler; import android.widget.ImageView; import android.util.Log; import com.google.android.gms.common.ConnectionResult; import com.google.android.gms.common.api.GoogleApiClient; import com.google.android.gms.wearable.Asset; import com.google.android.gms.wearable.DataApi; import com.google.android.gms.wearable.DataEvent; import com.google.android.gms.wearable...