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

Establishing connections for the mobile activity

Until now, we have created our project and the user interface for the mobile in our application. Also, we have set up our permissions so that our application can communicate with the Internet and Google Play Services.

In order for our app to communicate between the handheld and the Android wearable, we will need to establish a connection:

  1. From the Project Navigator window, expand the mobile section, select, and expand the java section.
  2. Next, double-click to open MobileActivity.java, and add the following code snippet:
    public class MobileActivity extends ActionBarActivity { private GoogleApiClient mGoogleApiClient; private static final String LOG_TAG = "MobileActivity"; // establishes a connection between ...

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