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:
- 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.
- 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:
- 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.
- Register for Control API Version 2.0 when it is available by returning 2 in RegistrationInformation.getTargetControlApiVersion().
- 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.
- Read about our latest Sony Add-on SDK updates in our recent Sony Add-on SDK blog post.
- Learn more about the features of the latest Sony Add-on SDK.
- Download and install the latest version of the Sony Add-on SDK from the Sony Add-on SDK installation page.
- Find out all about the Smart Extension APIs and how to create apps for Sony accessories, including Sony SmartWatch 2 (SW2) and the original Sony SmartWatch (MN2).