Skip to main content

DeviceSensors

Namespace: Wisej.Hybrid

Assembly: Wisej.Hybrid (4.1.0.0)

Provides integrations to interact with device sensors.

public class DeviceSensors : DeviceInfoBase

Access this class through the Device singleton.

Properties​

Instance member IsAccelerometerSupported​

Boolean: Gets a value indicating whether the accelerometer is supported.

Instance member IsBarometerSupported​

Boolean: Gets a value indicating whether the barometer is supported.

Instance member IsCompassSupported​

Boolean: Gets a value indicating whether the compass is supported.

Instance member IsGyroscopeSupported​

Boolean: Gets a value indicating whether the gyroscope is supported.

Instance member IsMagnetometerSupported​

Boolean: Gets a value indicating whether the magnetometer is supported.

Instance member IsOrientationSupported​

Boolean: Gets a value indicating whether the device orientation is supported.

Instance member IsShakeSupported​

Boolean: Gets a value indicating whether shake detection is supported.

Methods​

Instance member IsMonitoringAsync(type)​

Gets whether the given SensorType is available for monitoring on the hybrid device.

ParameterTypeDescription
typeSensorTypeThe type of sensor.

Returns: Task<Boolean>. True if the given SensorType is available for monitoring.

Instance member IsSupportedAsync(type)​

Gets whether the given SensorType is supported on the hybrid device.

ParameterTypeDescription
typeSensorTypeThe type of sensor.

Returns: Task<Boolean>. True if the given SensorType is supported.

Instance member OnWebUpdate(info)​

Updates sensor information based on the data provided from a web source.

ParameterTypeDescription
infoObjectDynamic object containing sensor support information.

This method expects the 'info' parameter to have properties matching the sensor names, and their values should be strings that can be parsed to booleans.

Instance member Start(type)​

Starts monitoring the given SensorType on the hybrid device.

ParameterTypeDescription
typeSensorTypeThe type of sensor.

Instance member Stop(type)​

Stops monitoring the given SensorType on the hybrid device.

ParameterTypeDescription
typeSensorTypeThe type of sensor.

Events​

Instance member AccelerometerChanged​

EventHandler<AccelerometerChangedEventArgs> Occurs when accelerometer reading changes.

Instance member BarometerChanged​

EventHandler<BarometerChangedEventArgs> Occurs when barometer reading changes.

Instance member CompassChanged​

EventHandler<CompassChangedEventArgs> Occurs when compass reading changes.

Instance member GyroscopeChanged​

EventHandler<GyroscopeChangedEventArgs> Occurs when gyroscope reading changes.

Instance member MagnetometerChanged​

EventHandler<MagnetometerChangedEventArgs> Occurs when magnetometer reading changes.

Instance member OrientationSensorChanged​

EventHandler<OrientationSensorChangedEventArgs> Occurs when the orientation sensor reading changes.

Instance member ReadingChanged​

Deprecated memberDeprecated: This event will be removed in future releases in favor of sensor-specific events. EventHandler<SensorChangedEventArgs> Fires when a sensor's reading changes.

Instance member Shake​

EventHandler Occurs when the device is shaken.