O'Reilly logo

Android Wearable Programming by Steven F. Daniel

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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:

  1. From the Project Navigator window, open the WearActivity.java file:
    Receiving messages using MessageAPI
  2. Next, add the following highlighted import statements in the WearActivity.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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required