Thursday, 9 June 2016

How to start the Wearable Android App Development ?

The Android Wear SDK was officially launched at Google I/O back in June 2014.Android Wear is a version of Google’s Android operating system designed for smartwatches and other wearables. It helps display notifications and integrates the Google Now functionality by pairing with mobile phones. The Wear SDKincludes code samples, documentation required to build applications that directly run on wearable, create custom user interfaces and sync data between mobile phones and wearables.
However, it is important for developers to first setup their environment in order to create wearable applications. This tutorial helps to setup up the Eclipse IDE for Android Wear development.
Pre-requisites: Eclipse IDE, Android Wear SDK
Step 1: Install Android Wear SDK and support repository
Before creating wearable applications, one needs to download and install the Android Wear SDK from the SDK manager as shown below. One also needs to install the Android support repository from the Extras section.


Step 2: Create support library project
Once the Android Wear SDK has been installed successfully, one will find thewearable folder present under,
{ANDROID_SDK}\extras\google\m2repository\com\google\android\support\
Next, rename the wearable-1.0.0.aar file as wearable-1.0.0.zip and extract the .zip file to obtain the wearable Android project. Now, launch Eclipse IDE and choose File –> Import –> Existing Android code into workspace. Navigate to the path where the project exists and import the same. Finally, create a libsfolder and move the classes.jar in the libs folder. Right click the imported project, go to Android, select build target as Android 4.4W.2 and tick the checkbox Is Library. This makes sure that the project is setup as a library project targeting Android API 20.


Create library project
Our final project structure would look something like this,

Project Structure
One can now create a new Android Wear project, or import one of the samples that come with the SDK, and add the above Wear support library as a dependency.
That’s it for this tutorial.  :)

No comments:

Post a Comment