VRDeviceService provides an interface to implement DeviceService, in order to return a tracked (e.g. HMD or controller), such as an HMD, controller, or external device to the server.

Device Class

The device manufacturer needs to provide the vector for VRDevice. The device count and device class must be provided in this function.

// register VRDevice.
public void onCreate() {
    VRDevice hmdDevice = new HmdDevice(this);
    VRDevice ctrlDevice = new ControllerDevice(this);


This is an abstract function and must be implemented.

Bind Service

Check the diagram below for the VR DeviceService (onBind, onRebind, onUnbind) flow. If the device manufacturer needs to implement them for their request, the device manufacturer must call super.onBind(intent), super.onRebind(intent).

Runtime will automatically connect the device when super.onBind(intent) and super.onRebind(intent) are called. It will stop the device when super.onUnbind(intent) is called.

public IBinder onBind(Intent intent) {
    return super.onBind(intent);


If the onBind function needs to be overridden, it must return super.onBind().

public void onRebind(Intent intent) {
    return super.onRebind(intent);


If the onRebind function needs to be overridden, it must call super.onRebind()

public boolean onUnbind(Intent intent) {
    return super.onUnbind(intent);


If the onUnbind function needs to be overridden, it must call super.onUnbind()

For more details about onBind, onRebind and onUnbind, see com/htc/vr/sdk/pluginkit/package-index and com/htc/vr/sdk/pluginkit/VRDeviceService.