VRDeviceService

public abstract class VRDeviceService extends Service

VRDeviceService provides a interface for developer to implement DeviceService.

Fields

mDecorator

VRDeviceDecorator mDecorator

Methods

action

public void action(String action)
Parameters:
  • action

getDevices

public final Vector<VRDevice> getDevices()

The device service need provide vector of VRDevice.

Returns:VRDevice vector

onBind

public IBinder onBind(Intent intent)

Return the communication channel to the service. MUST RETURN super.onBind();

Parameters:
  • intent – The Intent that was used to bind to this service.
Returns:

IBinder Return an IBinder through which Vr Runtime can call device service.

onCreate

public void onCreate()

Called by the system when the service is first created.

onDestroy

public void onDestroy()

Called by the system to notify a Service that it is no longer used and is being removed. The service should clean up any resources it holds (threads, registered receivers, etc) at this point. Upon return, there will be no more calls in to this Service object and it is effectively dead. Do not call this method directly.

onRebind

public void onRebind(Intent intent)

Called when new clients have connected to the service, after it had previously been notified that all had disconnected in its onUnbind(Intent). This will only be called if the implementation of onUnbind(Intent) was overridden to return true. MUST CALL super.onRebind();

Parameters:
  • intent – The Intent that was used to bind to this service.

onUnbind

public boolean onUnbind(Intent intent)

Called when all clients have disconnected from a particular interface published by the service. The default implementation does nothing and returns false. MUST CALL super.onUnbind();

Parameters:
  • intent – The Intent that was used to bind to this service.
Returns:

boolean Return true if you would like to have the service’s onRebind(Intent) method later called when new clients bind to it.

registerDevice

public void registerDevice(VRDevice device)

Register VRDevice in WaveVR Server

unregisterDevice

public void unregisterDevice(VRDevice device)

Unregister VRDevice in WaveVR Server