Android Wear – Part 3 – Set up wear emulator

By -

Welcome to the part 3 of Android wear application development series.

This series so far:

  • Part 1: Android Wear: Installation and Setup, where we discussed about what is Android Wear and some of the usages, installed Android 4.4W SDK and look into creating Android Wear virtual device.
  • Part 2: Android Wear: Hello World, where we wrote a Hello world program and run it successfully. We had also discussed about WatchViewStub and how it detects whether device is round or circle.

In this part

So far we are done with installation, setup and a simple hello world program. Today we are going to talk about how to set up wear emulator and pair it with phone/tablet device. It’s gonna be a fun for sure as you would be getting your phone notifications on your wearable device as cards.

Set up and pair Android wear emulator

  • Step 1: On your phone/tablet, install Android Wear app from play store.
  • Step 2: Connect the phone/tablet to your laptop through USB cable.
  • Step 3: Start Android watch emulator as mentioned in Part 1 – Installation & Setup, and wait until home screen appears.
  • Step 4: Open command prompt and run ‘adb devices‘ command, and make sure it shows emulator and phone/tablet in a connected devices list.
  • Step 5: Now, Run the below command to forward AVD’s communication port to your phone/tablet. Do this practice every time you connect your phone/tablet.
  • adb -d forward tcp:5601 tcp:5601
    

    adb devices - android wear

  • Step 6: Start the android wear app on your device to connect with android watch emulator. Click on watch icon given on title bar, it will connect your device with android watch emulator.

    android wear - emulator connected

  • Step 7: Now, we are done with pairing Android watch emulator with android phone/tablet.
  • Step 8: Now, just to view some demo cards and to have fun, click on overflow menu icon and select ‘Demo cards’ from the menu options. Select any demo card from the given cards list and check the same card in android wear emulator.

    android wear watch - demo cards

  • Step 9: To view demo of some cards, enable Google Now in your android phone. As our android wear emulator is connected, it will fetch and display some of the Google now cards too.
    android wear watch _ pairing 1

    android wear watch _ pairing 3

Summary

In this part, we talked about setting up wear emulator and pairing it with phone or tablet, have seen some of the demo cards and also demo of Google now cards. In next part, we will see how notifications works in android wear and will develop a basic demo. Till the next part, keep playing with demo cards and try to get Google now cards into android wear.

Paresh Mayani

Lazy android developer, exploring the horizon of android development since 7 years, currently working as a Technical Lead - Android at Simform Solutions, India. Former Application Architect at KarConnect. He is the Head/Organizer of Google Developers Group (GDG), Ahmedabad

Loading Facebook Comments ...
Loading Disqus Comments ...