Get Started

This project is no longer being supported and will not get any further updates.

Follow the steps in these sections to quickly get started with your SmartWatch 2 app development.

Step A. Install the Android SDK and Sony Add-on SDK

Before you begin the setup for your SmartWatch app development, you must first install the Android SDK (if you haven’t already done so), and then install the Sony Add-on SDK.

1. Install the Android SDK

The Android SDK provides the API libraries and developer tools necessary to build, test and debug apps for Android.

If you’re a new Android developer, you should download the full SDK ADT bundle, which includes everything you need to begin developing apps:

  • Eclipse + ADT plugin.
  • Android SDK Tools.
  • Android Platform-tools.
  • The latest Android platform.
  • The latest Android system image for the emulator.

2. Install the Sony Add-on SDK

The Sony Add-on SDK provides Javadocs, code examples, an emulator, and the Smart Extension API libraries necessary to build, test and debug apps for SmartWatch 2. Follow the instructions below to install the Sony Add-on SDK using Android SDK Manager.

Note! The following instructions for installing the Sony Add-on SDK requires you to have the Android SDK and Eclipse installed on your computer (you may also be using other developer tools).

  1. Start the Android SDK Manager in Eclipse by navigating to Window > Android SDK Manager.
  2. The Android SDK Manager will open. In the Android SDK Manager menu, navigate to Tools > Manage Add-on Sites….
  3. Click the tab for User Defined Sites.
  4. Click New… on the displayed dialog.
  5. Enter the following URL in the Add Add-on Site URL dialog:
    http://dl.developer.sony.com/wearables/sdks/Sony_Add-on_SDK/Sony-Add-on-SDK.xml
  6. Click OK.
  7. Click Close and confirm that you are sorting the SDKs listed by API level.
  8. Expand the field that displays the SDKs available under Android 4.4.2 (API 19), select the checkbox for the Sony Add-on SDK, then click Install 1 package… The Sony Add-on SDK will now install.

Note! A more detailed Sony Add-on SDK installation instruction, with screenshots, is also available. You can also learn how to install the Sony Add-on SDK manually.

Step B. Set up the development environment

Now that you have installed the Sony Add-on SDK, the next step is to set up your development environment (IDE). In this example, we will use Eclipse and import the HelloLayouts project, which is a basic example of the most common use case of drawing a layout to the SmartWatch 2 display.

To set up your IDE, perform the following steps:

  1. Start Eclipse and go to File > Import to display the Import screen.
  2. In the Import screen, navigate to Android and select Existing Android Code Into Workspace, then click Next.
  3. On the next screen, click Browse then navigate to the samples folder of the Sony Add-on SDK, then press OK to display a list of all sample projects.
  4. Select the project called HelloLayouts, as well as SmartExtensionAPI, SmartExtensionUtils, then click Finish. This imports the HelloLayouts project into Eclipse.

Important note: The HelloLayouts project is the actual code example project. The SmartExtensionAPI and SmartExtensionUtils projects are libraries that are necessary to compile and run all Smart Extensions projects, so you will always need to include these in any project you create.

  1. Next, right-click on the HelloLayouts project, then select Properties > Android.
  2. Under the Project Build Target field, select Sony Add-on SDK 3.0, then click OK.
  3. If you do not have “Build Automatically” checked under in the “Project” menu, then you will need to compile the projects in this order: SmartExtensionAPI, SmartExtensionUtils, HelloLayouts.
  4. Your project should now compile without any errors. If you see any errors, you may need to go to Project > Clean, select the HelloLayouts project, then press OK to clean your workspace and try again.
  5. Once done, your project is now build and you are ready to move on to configuring your test environment.
Step C. Configure a test environment setup

Now that you have a compiled APK, let’s set up the environment with which to test it. You can set up the testing environment in the following ways:

  • By using the SmartWatch 2 device.
  • By using the Accessory Emulator on a phone or tablet.
  • By using the Accessory Emulator running on an Android Virtual Device.

If you don’t have a SmartWatch 2 device to test with, you can still set up your test environment without the hardware by using the Accessory Emulator included with the Sony Add-on SDK.

1. Set up a test environment with SmartWatch 2 device

Using an actual device to test your SmartWatch 2 app ensures the best testing, as it provides a real user environment. Some features, like accelerometer, cannot be simulated or may provide inaccurate results if you try to simulate. Also, defects are easier to expose using actual devices.

To set up your SmartWatch 2, follow to Startup guide instructions included with your SmartWatch 2 device, or download the SmartWatch 2 User Guide.

To learn how to set up your SmartWatch 2 device for app testing, see the Test and Verify page.

2. Test environment setup with Accessory Emulator on a phone or tablet

Using the Accessory Emulator included with the SDK is an inexpensive alternative to testing on an actual device. This is most useful for identifying issues during the early stages of your app development. However, using an emulator cannot completely mimic an actual device or environment. To completely test a feature or an app, the testing should ideally be performed on an actual device along with the Accessory Emulator.

To learn how to set up the Accessory Emulator, see the Test and Verify page.

3. Test environment setup with the Accessory Emulator running on an Android Virtual Device

If you don’t have access to a phone or tablet, you can also run the Accessory Emulator on top of another emulator – an AVD. An AVD is a device configuration for the Android Emulator that allows you to model different configurations of Android devices. In order to test on an Android AVD with the Accessory Emulator, you will need to:

For instructions on how to set up the Accessory Emulator running on an AVD, see the Test and Verify page.

Step D. Start developing!

After you’ve installed the Android SDK and Sony Add-on SDK, and prepared your developing and test environment, it’s time to start developing. A number of different resources are available to support you during your SmartWatch 2 development. This includes:

  • Guides that show you, for example, how to register your app, how to create your app UI, how to access sensor data, how to receive a notification, and much more. Here you can also find Architecture & system component descriptions to summarize the most important elements involved in SmartWatch 2 development, and hardware specifications that list supported features and capabilities of SmartWatch 2.
  • API references to explain methods and classes for the Smart Extension APIs. (The API references are available online in the menu to the left, but also as offline HTML files in the Sony Add-on SDK.
  • Design guidelines that define the size and appearance of SmartWatch 2 icons and buttons.
  • Tutorials that provide detailed walkthroughs for specific use cases including How to create a SmartWatch 2 app , How to add SmartWatch 2 support to your original SmartWatch app, and Use both the Control & Notification APIs for customized UIs in your SmartWatch 2 app.
  • Code examples that detail how to receive notifications, sensor data and more.  You can find all the code examples located /samples/SmartExtensions folder in the Sony Add-on SDK package.

Learn more by clicking any of the SmartWatch 2 sections to the left!