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 image data using DataApi

In the previous section, we looked at how we can use the DataApi.putDataItem method to send a binary image data to the Android wearable. In this section, we will be taking a look at how we can retrieve the image and display it within our Android wearable watch area:

  1. From the Project Navigator window, open the WearActivity.java file.
  2. Next, modify the WearActivity class and add the following code snippet:
    public class WearActivity extends Activity { private TextView mTextView; private ImageView imageView; private GoogleApiClient mGoogleApiClient; private Bitmap imageBitmap; private final Handler imageHandler = new Handler(); @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); ...

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