SmartWatches

Add SmartWatch 2 support to your original SmartWatch extension

Now that the Sony SmartWatch 2 is available, you might be wondering how to make your existing SmartWatch app compatible with the new SmartWatch 2. For app extensions developed for the first SmartWatch that use the Notification API or Control API included in the Smart Extension APIs, some minor updates are needed in order to be optimised for SmartWatch 2. Read on for the important details for adding compatibility to make your app extension usable for both SmartWatches.

The Sony SmartWatch 2 is our newest Android™ wireless accessory designed to complement your smartphone. It has several notable improvements over the original SmartWatch, including NFC support, a larger display (1.6”) with higher resolution (220 x 176 pixels) and better readability in direct sunlight, IP57 certification for water resistance, and a longer battery life.

In order to develop apps that can interact with the original Sony SmartWatch and Sony SmartWatch 2, you must use the Smart Extension APIs that are included as part of the Sony Add-on SDK, as described in our recent Sony Add-on SDK blog post. If you’ve already developed an app extension for the original SmartWatch that uses the Notification API or Control API, the following sections describe what you’ll need to do to make your app extension work on SmartWatch 2. For the Notification API and Control API, these changes are recommended, as they will allow your extension to run more smoothly. If you do not apply these changes, your extension will still work on SmartWatch 2.

Recommended changes for the Notification API
The Notification API is part of the Smart Extension APIs, and is used by simple event driven data providers, such as SMS text message, MMS, and Missed calls. The updated Notification API (Version 2.0) now has support for icons in action menus for sources, and support for extensions specifying a colour to be associated with a source. To make use of these Notification API features for SmartWatch 2, you should:

  1. Set the colour of the status bar when showing events by setting Notification.SourceColumns.COLOR in RegistrationInformation. getSourceRegistrationConfigurations(). Setting the colour of the status bar is only supported in SmartWatch 2.

    SmartWatch 2 displaying notification colour in status bar.

    SmartWatch 2 displaying notification colour in status bar.

  2. Use icons instead of text strings for the action menu, by adding: Notification.SourceColumns.ACTION_ICON_1, ACTION_ICON_2 and ACTION_ICON_3 in RegistrationInformation. getSourceRegistrationConfigurations().

If the extension doesn’t specify a colour, the accessory may choose how to handle this. SmartWatch 2 will use a default colour. If icons are not specified, the text will be used in the menus. The original SmartWatch will ignore the colour if an extension sets it. Also, if the extension isn’t using the helper classes provided in SmartExtensionUtils (used by the code examples), then you should try to not register the new values if the extension is used on an old version of Smart Connect.

Recommended changes for Control API
The Control API is part of the Smart Extension APIs, and gives you full control of the accessory’s screen. The updated Control API (Version 2.0) now has support for using a subset of Android layouts to render data on the accessory, support for ListView and Gallery for smoother and more efficient scrolling, as well as support for specification of menus. To make use of these Control API features for SmartWatch 2, you should:

  1. Use Control API Version 2.0 when running on the SmartWatch 2, and still use Control API Version 1.0 when running on the first SmartWatch. The SampleControlExtension code example included in the Sony Add-on SDK package is one example of such an implementation.
  2. Register for Control API Version 2.0 when it is available by returning 2 in RegistrationInformation.getTargetControlApiVersion().
  3. Use DeviceInfoHelper.isSmartWatch2ApiAndScreenDetected() to check if Control API Version 2 is available for the current host application.

Additional SmartWatch 2 developer notes
The Widget API, another Smart Extension API, enables you to display a widget on a Smart Accessory. Widgets are not supported in SmartWatch 2. If you’ve developed an extension for the first SmartWatch, it is okay if the app extension registers itself as using the Widget API when registering to a SmartWatch 2 – it will just be ignored by SmartWatch 2.

When running on SmartWatch 2, your extension should use updated graphics to make full use of the 220 x 176 pixel screen. Updated graphics will be automatically rescaled when the extension is run on the original SmartWatch. Graphical resources that are used on SmartWatches should be placed in the nodpi folder of your project to decrease the risk of unintentional scaling.

It is important to test your app extension on the actual hardware or on the Accessory Emulator to ensure that app extension behaves as expected, and looks properly on the display. After you have verified that your app works on SmartWatch, 2 it is recommended to add Smart Connect extension for SmartWatch 2 to your Google Play™ description to help users find your app.

More information

Comments 6

Sort by: Newest | Oldest | Most popular

  1. By Michael Diener

    #2

    I was trying to port my existing app from SW 1 to SW 2 and stumbled upon the limitation that it is not allowed to have notifications and a control for the same app (even when setting LAUNCH_MODE to CONTROL).

    As a workaround I tried to register 2 services, one for the notification and one for the control. As they share the same app package name, this didn’t work and only the first that registered was available.

    Will this limitation be addressed in a future update? My app really depends on both, the notifications and the control.
    Or is there a better workaround?

    • By Joe Padre

      #3

      Hey Michael,
      Thanks for your question. Checking with our engineers on a good workaround. Will get back to you as soon as they have an answer.
      Best regards,
      Joe from Developer World

  2. By Markus Minichmayr

    #4

    Hi!
    I want to write an application that reads and writes NFC NDEF tags. Is this possible with the SmartWatch 2? If not, is it possible to used Android Beam with it?
    Best, Markus

    • By Joe Padre

      #6

      Hey Damian,
      No, sorrry, there is no software available to allow you to create alternative firmware for the SmartWatch 2, only the original SmartWatch.
      Best regards,
      Joe from Developer World

1-6 of 6 comments.