Written by Zachary Smith
Updated over a week ago


The SDK exposes functionality of the external hardware. There are multiple SDK interface classes to handle each set of related behaviors. These are described in subsequent sections below. Before using the specific behavior of each interface class, you must explicitly connect to the interface. To do so, create an instance of the appropriate interface class, then call its connect() method.

If the USB-C Viewer is not available, the connect() call will throw an exception. You may optionally query isDeviceAvailable() prior to connect() to avoid generating an exception.

If you use runtime permissions instead of manifest permissions you should use isDeviceAvailableAndAllowed() instead of isDeviceAvailable() to add the additional permission check.

Since your application may be run without the device being attached, you may also start a listener to detect device connection changes. This will automatically detect if dynamic permissions are required for the new device and prompt the user for those as well. You will receive a callback indicating when the device is ready to use. Register this by calling registerDeviceMonitor(). This returns true if the device is already connected and fully ready to use, identically to the return of isDeviceAvailableAndAllowed(). This is the preferred connection check.

If you started listening for device stat changes, call unregisterDeviceMonitor when device state changes are no longer required.

Close the connection by calling disconnect() when the interface is no longer required.

To track whether or not you have connected you may evaluate the connected boolean property of the interface class.

A sample of that flow, minus exception handling, might look like:

if( !usbcInterface.connected ) { 
if( usbcInterface.registerDeviceMonitor(myUsbStateChangeHandler) ) {
if( usbcInterface.connected ) {
//todo: do something with the interface while connected, then


The Flashlight interface is com.vuzix.sdk.usbcviewer.flashlight.Flashlight.

The Flashlight interface class will allow you to toggle the ON/OFF state of the device Flashlight.

Once a connection is initialized you may simply call turnFlashlightOn() and turnFlashlightOff().


The Sensors interface is com.vuzix.sdk.usbcviewer.sensors.Sensors.

The Sensors interface class will allow you to receive data from the device sensors. They come back in the following formats:

  • Accelerometer: meters per second squared

  • Gyrometer: degrees per second

  • Magnetometer/Compass: µ Teslas

The Sensors object requires a VuzixSensorListener. This is very similar to an Android SensorEventListener and all results are given to the onSensorChanged() method. VuzixSensorListener also adds an onSensorInitialized() to know when the asynchronous initialization completes on the device, and an onError() in case the initialization fails or the device disconnects after being initialized.

Once the connection is established, you will need to enable the sensors by calling initializeSensors(). This interface provides boolean parameters to explicitly enable or disable each sensor that is required.

Once the sensor data is initialized, you will receive the data in the form of a VuzixSensorEvent object. This contains a sensorType value of type Sensor.TYPE_ACCELEROMETER, Sensor.TYPE_MAGNETIC_FIELD, Sensor.TYPE_GYROSCOPE, or Sensor.TYPE_ROTATION_VECTOR.

The data is stored in the values array and the axis corresponds as such:

  • values[0] = x-axis

  • values[1] = y-axis

  • values[2] = z-axis

For rotation vectors a fourth float is included:

  • values[3] = w-axis

The axes returned by the SDK are defined according to the standard Android Mobile Device Axes when the device being worn on the right eye. Note: The axes from the SDK different are different than the raw data described in the M400C data sheet.

M400-C Sensor Orientation

Technical Support

Developers that own Vuzix USB-C viewer hardware may direct integration questions to Vuzix technical support.
See the Github Repository here:

Did this answer your question?