Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Book Overview & Buying Android Wearable Programming
  • Table Of Contents Toc
Android Wearable Programming

Android Wearable Programming

By : Steven F. Daniel
4 (2)
close
close
Android Wearable Programming

Android Wearable Programming

4 (2)
By: Steven F. Daniel

Overview of this book

If you are an Android developer who wants to learn how to build applications for the Android Wear platform, then this is the book for you. This book only requires a basic knowledge of Android programming. Familiarity with development IDEs such as Android Studio, IntelliJ IDEA, or Eclipse will be helpful.
Table of Contents (8 chapters)
close
close
7
Index

Sending messages to the Android wearable


In this section, we will be taking a look at the steps involved in sending a message to your Android wearable device. This process is quite simple, and our next step is to write the code that will communicate between our Android wearable and the handheld device:

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

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

    @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 EditText mSendMessageInput = (EditText) 
      findViewById(R.id.send_message_input);
    
      // Set up our hint message for our Text Field
      mSendMessageInput.setHint(R.string.send_message_text);
    
  3. Next, we need to set up an onClickListener method...

CONTINUE READING
83
Tech Concepts
36
Programming languages
73
Tech Tools
Icon Unlimited access to the largest independent learning library in tech of over 8,000 expert-authored tech books and videos.
Icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Icon 50+ new titles added per month and exclusive early access to books as they are being written.
Android Wearable Programming
notes
bookmark Notes and Bookmarks search Search in title playlist Add to playlist font-size Font size

Change the font size

margin-width Margin width

Change margin width

day-mode Day/Sepia/Night Modes

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Confirmation

Modal Close icon
claim successful

Buy this book with your credits?

Modal Close icon
Are you sure you want to buy this book with one of your credits?
Close
YES, BUY

Submit Your Feedback

Modal Close icon
Modal Close icon
Modal Close icon