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

Transferring image data to the Android wearable


In our previous section, we looked at how we can send messages from our Android handheld device and display this information within our wearable watch area. In this section, we will take a look at the steps involved in downloading an image from the Internet, compressing the file contents in memory before sending this to the Android wearable, and displaying this within the watch area:

  1. From the Project Navigator window, open the MobileActivity.java file.

  2. Next, modify the onCreate(Bundle savedInstanceState) method and enter the following highlighted code sections:

        @Override
        protected void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            setContentView(R.layout.activity_mobile);
    
           // Get a pointer to our buttons and textField
           final Button mSendMessageButton = (Button) 
           findViewById(R.id.send_message_button);
           final Button mSendImageButton = (Button) 
           findViewById(R.id...