Book Image

Android Wearable Programming

By : Steven F. Daniel
Book Image

Android Wearable Programming

By: Steven F. Daniel

Overview of this book

Table of Contents (14 chapters)
Android Wearable Programming
Credits
About the Authors
Acknowledgments
About the Reviewers
www.PacktPub.com
Preface
Index

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:

  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 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...