Important terms and components
- These are the most important terms and components related to SmartWatch 2 development.
In the areas of SmartWatch 2 development and Smart Extension APIs, we’ve introduced a few different terms that we’re using in these pages:
The Accessory Emulator is an APK that either comes installed in the Android emulator included with the Sony Add-on SDK, or as an apk file in the apks directory of the Sony Add-on SDK, which you can then install on a phone or tablet.
The Accessory Emulator can emulate these accessories:
- SmartWatch 2
- Smart Headset products
The Control API is the most advanced API and it lets your SmartWatch 2 app take full control over the accessory display. This Smart Extension API renders images, handles touch events, key presses and more. The Music player in the SmartWatch supporting the Control API is one example of a SmartWatch 2 app that uses this API to allow the user to interact with the device’s music player app.
The Control API allows SmartWatch 2 apps to render on the accessory display using images, or by using an XML-based layout. Another feature of this API is support for Active Low Power mode. In this mode, the app provides its display data as black and white images, thus enabling power saving for devices that can use less power when displaying black and white instead of color.
With the Control API, it is also possible for a SmartWatch 2 app to run in the foreground while the backlight is off on the accessory. The app keeps staying visible and the screen will be able to refresh its content. You will also be able to interact with the accessory as it listens to touch events and key presses.
The host application handles all interaction with the accessory. There is one host application for each Smart Accessory. The host application uses the content providers in Smart Connect to find information about which Smart Extension apps should be available on the accessory. It is also closely tied to one of the Smart Extension APIs – Notification API. In this case, it reads the notification in the Notification API content provider and presents them in a way that is suitable for the accessory. Applications using the Smart Extension APIs interact with the SmartWatch 2 through the host applications and Smart Connect.
The Notification API is used to add events to a content provider in Smart Connect. The host application then renders the events in the way that is most suitable for the SmartWatch 2. Messaging is one other example of a SmartWatch app that uses the Notification API to show text messages and MMS on the accessory. Other ways the Notification API can be used by simple, event driven data providers also include missed calls, Facebook™, and Twitter™.
Registration and Capabilities API
The Registration and Capabilities API is used by the host application to inform Smart Extension APIs about the capabilities of the SmartWatch 2. It is also used by the SmartWatch 2 app to inform the host application about which of the other APIs that are used.
The Sensor API makes sensor data available to the SmartWatch 2 app, for example light and accelerometer readings. SmartWatch 2 sensors include a light sensor and accelerometer.
A Smart Accessory is a Sony wearable device, such as SmartWatch, SmartWatch 2, and Smart Headset products, that you can create apps for.
Smart Connect is a software framework for Android devices that manages applications and related settings for SmartWatch 2 and other Smart Accessories from Sony. Smart Connect is pre-installed on all Xperia devices, and can be downloaded for other devices from Google Play. Smart Connect must be installed on the device before installing Smart Extension applications. Some accessories, such as SmartWatch 2, require a new version of Smart Connect.
The content providers for two of the Smart Extension APIs – the Notification API and the Registration and Capabilities API – are part of Smart Connect.
A Smart Extension is actually an Android app that has been “extended” to work with SmartWatch. This means you can either take your existing app to add support for the Smart Extension APIs, or you can create a completely new app for SmartWatch 2.
The app will still be installed and run on your Android tablet or phone, but the SmartWatch 2 can be set up to communicate and show content, through touch events (touch-based finger activity) or key events (key press activity). For example, you can create apps for simple tasks like checking the weather, managing a call, navigating through a playlist, reading messages or social network service alerts and so on.
Smart Extension APIs
Smart Extension APIs provide a way to develop apps, or extend existing apps to function with SmartWatch 2, and other Sony smart accessories.The Smart Extension APIs provides access to the display, widgets, notifications and other general controls in SmartWatch 2. You can develop SmartWatch 2 apps based on the different Smart Extension APIs, which include Registration and Capabilities, Notification, Control, Sensor, and Widget.
The SmartExtensionsAPI is a library that includes the API definitions for SmartExtensions. This library is necessary to compile and run all SmartWatch 2 app projects, and can be found in the samples folder of the Sony Add-on SDK package.
The SmartExtensionUtils is a utility library for SmartExtensions APIs. This library is necessary to compile and run all SmartWatch 2 app projects, and can be found in the samples folder of the Sony Add-on SDK package.
Sony Add-on SDK
The Sony Add-on SDK is an add-on package that runs together with your standard Android SDK. With the Sony Add-on SDK, you can develop apps that make use of the APIs included with it, called the Smart Extension APIs.
The Widget API lets the SmartWatch 2 app show a preview of its contents on the accessory. One example use of this API is to show current city weather information on the home screen of the SmartWatch 2, giving end users possibilities of quickly glance at information. From Sony Add-on SDK version 3.0, it is possible to develop widgets and clocks for the SmartWatch 2 that the user can place on the SmartWatch 2 watch face.