August 7, 2014

Getting Started with Android Wear

The official SDK for Android Wear has been announced together with Android Wear during Google I/O 2014. If you want to start developing for Android Wear, you would need to download Android Studio 0.8+. You would also need to download the following packages using your SDK Manager:
  • Android 4.4W (API 20) > SDK Platform
  • Android 4.4W (API 20) > Android Wear ARM System Image
  • Android 4.4W (API 20) > Android Wear Intel System Image
Additionally, you can download the packages for Samples and Sources.

If you do not have an Android Wear device yet, you can create an emulator. To create one, go to the AVD Manager and click the Create... button. Fill it up with the name and the following details:
  • Device - Android Wear Round or Android Wear Square device types;
  • Target - Android 4.4W - API Level 20
  • CPU/ABI - Android Wear ARM (armeabi-v7a)
  • Keyboard - Select Hardware keyboard present
  • Skin - AndroidWearRound or AndroidWearSquare
  • Snapshot - Not selected
  • Use Host GPU - Selected



Creating an Android Wear Emulator

Click OK. You can now start this emulator.

To create a new Android Wear Project, follow the following steps:
  1. Open Android Studio
  2. Click New Project in the Welcome Screen (or File > New Project if you already have an open project).
  3. Fill up the project name and package name, then click the Next button.
  4. Check Phone and Tablet and select the Minimum SDK.
  5. Check Wear and select API 20: Android 4.4 (KitKat Wear) as the minimum SDK
  6. Click the Next button.
  7. In the Add activity to Mobile window, select Blank Activity then click the Next button. You can change the activity name, layout name, and title.
  8. In the Add activity to Wear window, select Blank Activity then click the Next button. You can change the activity name, and the layout names.
  9. Click the Finish button.
Run the mobile module to run it in your phone or tablet device (or emulator). To run and view the wearable app, run the wear module and choose your emulator. You will see something like the one below:


Hello Square World