public class SKSensorManager
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
protected SKAbstractSensor |
createSensor(SKSensorType sensorType) |
void |
deregisterSensor(SKSensorType sensorType)
Deregisters a sensor from the library.
|
SKSensorData |
getDataFromSensor(SKSensorType sensorType)
Get data from the sensor
|
protected SKAbstractSensor |
getSensor(SKSensorType sensorType) |
static SKSensorManager |
getSensorManager(Context context) |
boolean |
isSensorRegistered(SKSensorType sensorType)
A Boolean value that indicates whether the sensor is registered.
|
boolean |
isSensorSensing(SKSensorType sensorType)
A Boolean value that indicates whether the sensor is currently sensing.
|
void |
registerSensor(SKSensorType sensorType)
Initializes and registers a sensor into the library with a default sensor configuration.
|
void |
startContinuousSensingWithAllRegisteredSensors()
Starts continuous sensing with all registered sensors.
|
void |
startContinuousSensingWithSensor(SKSensorType sensorType)
Starts continuous sensing with the specified sensor.
|
void |
stopContinuousSensingWithAllRegisteredSensors()
Stops continuous sensing with all registered sensors.
|
void |
stopContinuousSensingWithSensor(SKSensorType sensorType)
Stops continuous sensing with the specified sensor.
|
void |
subscribeSensorDataListener(SKSensorType sensorType,
SKSensorDataListener dataListener)
Subscribes for sensor updates using a specified event listener.
|
void |
unsubscribeAllSensorDataListeners(SKSensorType sensorType)
Unsubscribes all event listenerss.
|
void |
unsubscribeSensorDataListener(SKSensorType sensorType,
SKSensorDataListener dataListener)
Unsubscribes an event listener.
|
public static SKSensorManager getSensorManager(Context context) throws SKException
SKExceptionpublic void registerSensor(SKSensorType sensorType) throws SKException
sensorType - The type of the sensor that will be initialized and registered in the library.SKExceptionpublic void deregisterSensor(SKSensorType sensorType) throws SKException
sensorType - The type of the sensor that will be deregistered.SKExceptionpublic boolean isSensorRegistered(SKSensorType sensorType) throws SKException
sensorType - The type of the sensor that will be checked.SKExceptionpublic boolean isSensorSensing(SKSensorType sensorType) throws SKException
sensorType - The type of the sensor that will be checked.SKExceptionprotected SKAbstractSensor getSensor(SKSensorType sensorType) throws SKException
SKExceptionprotected SKAbstractSensor createSensor(SKSensorType sensorType) throws SKException
SKExceptionpublic SKSensorData getDataFromSensor(SKSensorType sensorType) throws SKException
sensorType - of type SKSensorTypeSKExceptionpublic void subscribeSensorDataListener(SKSensorType sensorType, SKSensorDataListener dataListener) throws SKException
sensorType - The type of the sensor that the data handler will be subscribed to.dataListener - An event listener that is invoked with each update to handle new sensor data. The block must conform to the SKSensorDataListener type.SKExceptionpublic void unsubscribeSensorDataListener(SKSensorType sensorType, SKSensorDataListener dataListener) throws SKException
sensorType - The type of the sensor for which the event listener will be unsubscribed.dataListener - The event listener to be unsubscribed.SKExceptionpublic void unsubscribeAllSensorDataListeners(SKSensorType sensorType) throws SKException
sensorType - The type of the sensor for which the event listener will be unsubscribed.SKExceptionpublic void startContinuousSensingWithSensor(SKSensorType sensorType) throws SKException
sensorType - The type of the sensor that will be started.SKExceptionpublic void stopContinuousSensingWithSensor(SKSensorType sensorType) throws SKException
sensorType - The type of the sensor that will be stopped.SKExceptionpublic void startContinuousSensingWithAllRegisteredSensors()
throws SKException
SKExceptionpublic void stopContinuousSensingWithAllRegisteredSensors()
throws SKException
SKException