SmartWatch2_SW2_PIU_04_R2

How to create an app extension for Sony SmartWatch 2

With a SmartWatch 2 extension, your users can utilise the features of your app without even picking their smartphone or tablet up from their bag or pocket. At the same time, you can get a lot of extra visibility for your app, since it will be exposed to all users of the SmartWatch 2. So are you ready to develop a new app extension or extend your existing app to support the Sony SmartWatch 2? We’ve put together a quick tutorial that shows you from start to finish, what programs you need, files you should use, and tools you can make use of, and the steps involved in creating your own app extension for Sony SmartWatch 2. Read more after the jump. (Updated 12 Nov, 2013)

If you’re new to creating app extensions for Sony SmartWatch 2, the following steps will walk you through everything you need to know to get you up and running with your app extension development.

How to get started in three steps

  1. Download and install the Android SDK. The Android™ SDK provides you with the API libraries and tools necessary to build, test, and debug apps for Android.
  2. Download and install the latest version of the Sony Add-on SDK from the Sony Add-on SDK installation page. The Sony Add-on SDK is an add-on to the Android SDK that includes the Smart Extension APIs.Those are easy to use, intent-based APIs that make it possible to access the display, notification, and other general controls on SmartWatch 2. The Sony Add-on SDK comes with full code examples for Smart Extension APIs, an emulator, and API references. Learn more about the Smart Extension APIs from the Smart Extension APIs overview page.
  3. In the Sony Add-on SDK package, go to the samples > SmartExtensions folder, and select the Smart Extension API sample application that is most relevant to your app extension.
Sample Smart Extension APIs included with the Sony Add-on SDK package.

Sample Smart Extension APIs included with the Sony Add-on SDK package.

How to create your Smart Extension in Eclipse
Create the Smart Extension API sample application using Eclipse. For example, here’s how to create a Notification API sample application using the SampleNotificationExtension:

  1. Start Eclipse and navigate to: File > New > Other.
  2. Expand the Android directory, then select Android Sample Project.
  3. In the Select Build Target option, select Sony Add-On SDK 2.0.
  4. Click Next to create the sample application. In the Select Sample dialog box, select an appropriate sample based on the purpose of your application, for example, “SampleNotificationExtension”. Also enter the appropriate sample names here, making sure to name the sample accordingly, so that you know what the sample is for.
  5. Click Finish. Your project should now be created in the Package Explorer of the Eclipse. Note: The first two sample codes that should be imported are SmartExtensionAPI and SmartExtensionUtils. All other Smart Extension sample codes will need these library projects.

In addition, you also have the API references available online to provide you with the details and capabilities of the Smart Extension APIs.

How to run the application on SmartWatch 2
To run the sample application on SmartWatch, follow the steps below:

  1. Make sure the Android smartphone or tablet is connected and paired with SmartWatch 2.
  2. Connect the Android smartphone or tablet with the machine using USB.
  3. Make sure Android Debug Bridge (adb) is running and the device can be detected. You can download adb from the Android SDK main page.
  4. You can now directly run the Smart Extension code example in Eclipse on a selected device using Run > Run As and then selecting the device.
  5. The Smart Extension code example will install on the device and should also be visible on the accessory.

How to use the Accessory Emulator
To run the Accessory Emulator on an Android smartphone or tablet, follow the steps below:

  1. Download Smart Connect from Google Play™ and get the accessory_emulator.apk from the Sony Add-on SDK package, then install them on the smartphone using adb. Note: Smart Connect is already installed if you are using a Sony Xperia™ smartphone or tablet.
  2. Connect the Android smartphone or tablet with the machine using USB.
  3. You can now directly run the Smart Extension code example in Eclipse on a selected device using Run > Run As and then select the device.
  4. The Smart Extension code example will install on the device, and should also be visible on the Accessory Emulator application.
  5. Open the Accessory Emulator app from the app tray. For more information on the emulator, refer to the Accessory Emulator section in the How to use the Smart Extension APIs document.

Distribute your app and get valuable exposure
Create an APK file to publish on Google Play™. To make your app show up in the pre-defined Google Play™ search, just make sure the Google Play™ description for your app includes the following string (we recommend at the bottom, on its own line):

Smart Connect extension for SmartWatch 2

***

We hope you find this guide helpful for creating apps for SmartWatch 2. If you have any questions, feel free to drop us a line in the comments field below, and we’ll be happy to get back to you with an answer as soon as we can.

More information

Comments 5

Sort by: Newest | Oldest | Most popular

  1. By Erich Haubrich

    #1

    I’m looking forward to developing apps that allow camera control with cameras like the Sony A7S, A6000 and others.

  2. By Dennis Duong Trinh

    #2

    Is there any way to interact with the SW2′s USB port? I would like to connect a sensor module using usb and send data to connected smartphone.

    /Dennis

  3. By oscar diaz

    #3

    Hi, i am a beginner developer I would like to know how can I install this but in android studio help me please I’m new

  4. By Andr Simpl

    #4

    Hi, I am a developer interested in adding an extension for smartwatch to my app. I have a query. How exactly can I make money out of my free app through smartwatch? I doubt the banner ads would show up on the small screen of the watch. Correct me if i am wrong.

    • By Joe Padre

      #5

      Hi Andr,
      We agree that banners ads would be too small to show on the SmartWatch 2 display. You might consider and in-app purchase model, through Google Play, but the actual purchase would have to be done through the user’s phone. We’ve also seen developer put ads in their SmartWatch app by displaying a message “check phone” and then showing the banner ads on the phone. You could also look at similar app extensions to your own to get more ideas on how to monetize further. Hope that helps.
      Best regards,
      Joe from Developer World

1-5 of 5 comments.