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
SKException
public void registerSensor(SKSensorType sensorType) throws SKException
sensorType
- The type of the sensor that will be initialized and registered in the library.SKException
public void deregisterSensor(SKSensorType sensorType) throws SKException
sensorType
- The type of the sensor that will be deregistered.SKException
public boolean isSensorRegistered(SKSensorType sensorType) throws SKException
sensorType
- The type of the sensor that will be checked.SKException
public boolean isSensorSensing(SKSensorType sensorType) throws SKException
sensorType
- The type of the sensor that will be checked.SKException
protected SKAbstractSensor getSensor(SKSensorType sensorType) throws SKException
SKException
protected SKAbstractSensor createSensor(SKSensorType sensorType) throws SKException
SKException
public SKSensorData getDataFromSensor(SKSensorType sensorType) throws SKException
sensorType
- of type SKSensorTypeSKException
public 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.SKException
public 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.SKException
public void unsubscribeAllSensorDataListeners(SKSensorType sensorType) throws SKException
sensorType
- The type of the sensor for which the event listener will be unsubscribed.SKException
public void startContinuousSensingWithSensor(SKSensorType sensorType) throws SKException
sensorType
- The type of the sensor that will be started.SKException
public void stopContinuousSensingWithSensor(SKSensorType sensorType) throws SKException
sensorType
- The type of the sensor that will be stopped.SKException
public void startContinuousSensingWithAllRegisteredSensors() throws SKException
SKException
public void stopContinuousSensingWithAllRegisteredSensors() throws SKException
SKException