To create a SmartGlass experience, you need to write code that runs on the Xbox One console and code that runs on a SmartGlass-enabled device. Microsoft provides the SmartGlass Console API to Xbox One game and app devleopers so that those developers can create the console side of the SmartGlass experience for their titles. The SmartGlass Console API is available in the following development kits:
For reference information about the API elements in the SmartGlass Console API, see SmartGlass Console API Reference.
In the Xbox One SmartGlass experience, the SmartGlass-enabled device initiates the connection between the device and the Xbox One console. The title that runs on the Xbox One console can keep track of devices that connect to or disconnect from the Xbox One console by handling the events of the SmartGlassDeviceWatcher class.
When a device connects to the Xbox One console and the title handles the SmartGlassDeviceWatcher.DeviceAdded event, the title gets a SmartGlassDevice object that represent the device as a parameter for the event handler. The members of that SmartGlassDevice object provide the means for the Xbox One console to interact with that SmartGlass-enabled device.
You control the mode of operation for a SmartGlass device by using the SmartGlassDevice.SetActiveSurfaceAsync method to specify an instance of a SmartGlass surface that corresponds to the desired mode of operation. The following table describes the types of surface that SmartGlass provides and the capabilities of each surface.
| Surface Type | Capabilities |
|---|---|
| SmartGlassDirectSurface | [Deprecated] Enables device input and remote rendering. |
| SmartGlassHtmlSurface | Allows hosting of HTML5 and JavaScript and allows the use of the SmartGlass JavaScript APIs. |
| SmartGlassTextEntrySurface | Allows text entry from the SmartGlass device to the connected console. |
Receiving Notifications about the Addition and Removal of SmartGlass-Enabled Devices
Information about how to receive notifications about the addition and removal of devices that run SmartGlass-enabled apps in an Xbox One game or app.
Sending Messages from an Xbox One Console to a SmartGlass-Enabled Device
Information about how to send messages from an Xbox One to a SmartGlass-enabled device.
Receiving Messages from a SmartGlass-Enabled Device in an Xbox One Game or App
Information about how to receive messages from a SmartGlass-enabled device in an Xbox One game or app.
Receiving Accelerometer Data from a SmartGlass-Enabled Device
Information about how to use accelerometer data from a SmartGlass-enabled device in an Xbox One game or app.
Receiving Gyroscope Data from a SmartGlass-Enabled Device
Information about how to use gyroscope data from a SmartGlass-enabled device in an Xbox One game or app.
Using the Auxiliary Stream to Send Large Amounts of Data from an Xbox One Title to a SmartGlass Device
Information about how to use the auxiliary stream from an Xbox One title to a SmartGlass device.
Building a SmartGlass DirectX Game
In this tutorial, you will learn how to send and receive messages from SmartGlass devices. You will build a simple DirectX game that receives messages from SmartGlass devices and changes the color of the screen.