Android Wear Getting Started Tutorial
Android wear is a platform by Google for wearable devices. It was launched yesterday. For now it is for watches and later it may expand to other wearable like shoes, pen, etc. The Youtube video showcasing the features of Android Wear by Google is mind blowing.
It is game over for all other smart watches out there. The End. Android wear is simply amazing. Pebble, Samsung and Sony were the early entrants in the smart watch world. They are all going to be in serious trouble. Android wear is not a separate operating system by itself, it is extended from Android which makes it invincible. I am really excited because it opens up innumerable possibilities for innovation.
The best thing is, Google has opened up the platform immediately with a developer preview. We got an emulator for Android Wear in the SDK update. In this tutorial, I am will walk you through to setup the development environment to start programming for Android Wear. We will also see how cool the notifications are in the Android Wear emulator.
Android Wear was launched just yesterday and I have spent only one night with it yet :-) if you notice any errors in this tutorial, please post a comment to fix it.
Android Wear Developer Preview
For now the Android Wear platform is targeted for Watches. App will be running in a watch on Android Wear platform and it will be connected to an Android device. It is so exciting since, Android Wear is not just a notification app acting as an extension of the paired device. We can apply actions to it, communicate back to the device! By registering for the Android Wear developer preview we get the following,
- An Android emulator to run the Android Wear platform.
- We can connection our Android device to that Android Wear emulator and see the notifications in it and act on it.
- We get a support library with preview API using which we can enhance our Android apps to be compatible for Android Wear.
Steps to Start with Android Wear
- Signup for Developer Preview with Google. Once you signup Google will take some time to approve the request. After approval you will get a link to the ‘Android Wear Preview’ app from Google Play store.
- To setup the Android Wear emulator install the latest Android API and updates (API 19 required) lineup in the Android SDK Manager. Remember to install the ‘Android Wear ARM EABI v7a System Image’.
- Then create Android Virtual Device (AVD) for Wear using the system image just updated. There are two skins available for the Android watch round and square. I have chose square watch.
- Once the Wear AVD is created, launch that and keep it ready. Wear display will show a clock and a disconnected mobile icon to indicate that this wear is not paired with an Android device. If everything is right, you should get the following image.
- Lets connect our Android device to the computer via USB. In my case, I am using Google Nexus 4 mobile. You need a device with Android 4.3 or above. As per Google, we cannot do this device part with an emulator and we need a real Android device. After connecting the mobile with the computer, to pair the mobile with wear AVD, run the following command in command prompt at Android SDK directory/platform-tools.
adb -d forward tcp:5601 tcp:5601
If you get “error: device not found”, then the Android device (mobile) is not properly setup with the computer for debug and its not visible for ADB. You may have to enable the USB debugging mode in developer options, install the right USB device driver.
- Install Android Wear Preview app from Google Play store. Link to this will be enabled after you are an approved developer for Android Wear. Open that app and it should say connected.
Android Wear Notifications
Once the Android device and the Android Wear AVD is paired up, all the notifications received in the Android device are shown automagically in the Wear AVD. Following are some of the cool screenshots from the Android Wear Watch.
Android Wear SMS Notification with Open Action
Android Wear Missed Call Notification with Actions
Android Wear GMail Notification with Actions
Android developer preview has given a set of examples to achieve above in Android Wear platform. I will write about those examples in the next tutorial and subsequently write tutorials about how to Android Wear enable our own applications.
This Android tutorial was added on 20/03/2014.