Installation and Setup
Let us know how you feel about this.
last updated: 2017-01
This article walks through the installation steps and configuration details required to prepare your computer and devices for Android Wear development. By the end of this article, you'll have a working Xamarin.Android Wear installation integrated into Xamarin Studio and/or Microsoft Visual Studio, and you'll be ready to start building your first Xamarin.Android Wear application.
- Create Your First Android Wear App
After you have installed Xamarin.Android, perform the following steps so that you're ready to build and test Android Wear apps:
- Install the required Android SDK and tools.
- Configure a test device.
- Create your first Android Wear app.
These steps are described in the following sections.
Install Android SDK and tools
Launch the Android SDK Manager:
Ensure that you have the following Android SDK and tools installed:
- Android SDK Tools v 24.0.0 or higher, and
- Android 4.4W (API20), or
- Android 5.0.1 (API21) or higher.
If you do not have the latest SDK and tools installed, download the required SDK tools and the API bits (you may need to scroll a bit to find them – the API selection is shown below):
Before you can use test your app, you must configure an Android Wear emulator or an actual Android Wear device.
Android Wear Emulator
Before you can use an Android Wear emulator, you must configure an Android Wear Android Virtual Device (AVD) using the Google Emulator Manager:
Create a new Android Virtual Device using one of the Android Wear watch configurations:
For more information about setting up an Android Wear emulator, see Set Up and Android Wear Emulator or Device.
Android Wear Device
If you have an Android Wear device such as an Android Wear Smartwatch, You can debug the app on this device instead of using an emulator. If your Wear device has a USB port, you can connect the Wear device to your computer, deploy to it, and debug the app as you would on an Android phone.
If your Wear device does not have a USB port, you can debug the app over Bluetooth by routing the app's debug output to an Android phone that is connected to your development computer as described in the following steps.
Enable USB debugging on your phone:
If you have not already done so, set up your phone for Xamarin.Android development as explained in Set Up Device for Development.
Download and install the free Android Wear app from the Google Play Store.
Enable Bluetooth debugging on the device:
Open the Settings menu on the Android device.
Scroll to the bottom of the menu and tap About.
Tap the build number 7 times.
On the Settings menu, tap Developer Options.
Confirm that ADB debugging is enabled.
Enable Debug over Bluetooth.
If Bluetooth debugging has been configured successfully, you should see a screen like the following on the Android Wear device:
When you use the
adb command to set up a debugging session (as
Getting Started), the Android
Wear device will appear in the device pulldown menu of Xamarin Studio
or Visual Studio.
Create Your First Android Wear App
Follow the Getting Started instructions to build your first watch app.
Packaging Your App
Android wear applications are always distributed with a companion Android phone app.
When you add your Android Wear application as a reference to your main Android application it is automatically assumed to be an Android Wear project and will generate all necessary XML and metadata for you. In addition, it will verify that package and version numbers match so you can easily ship your apps to Google Play.
To learn more about packaging Wear apps, see Working with Packaging.