In order to get started you need to have already completed the following steps:
- Download the Android SDK
- Configure a Wearable device or Emulator
- Install the latest platforms and tools (either ADT/Gradle)
image 1: main app layout |
The app portion is primarily required in order to deploy the application on Google Play. It simply contains one Activity with a basic layout that notifies the user of the fact that it is a wearable application. (see image 1)
The most important part of the module is that it includes the wear app as a dependency, this way the wearable app will be automatically installed when the main application is installed. You can read more about your packaging options here.
The wear portion contains the activities and game logic that run on the actual wearable device. It uses the wearable support library in order to take advantage of two UI components: the BoxInsetLayout and the WearableListView.
The BoxInsetLayout is very useful for supporting both rectangular and circular devices because it allows you to define boundaries for its elements. We use it for the "Addition" and "Subtraction" views so that all three balloons are displayed in the viewable area.
Part 2 will cover the WearableListView provided in the support library. This post was based on the Balloon Pop Android application available on Google Play.