Class ActivitySensor
- java.lang.Object
-
- eu.h2020.helios_social.core.sensor.Sensor
-
- eu.h2020.helios_social.core.sensor.ext.ActivitySensor
-
public class ActivitySensor extends Sensor
This class provides an implementation of sensor API for detecting activities. ActivitySensor is a subclass of the abstract base class Sensor. It uses Android ActivityRegnitionClient API to detect activities and to update their values, as well as start and stop the activity detection updates
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description classActivitySensor.ActivityReceiverHandles intents from from the Activity Recognition API
-
Constructor Summary
Constructors Constructor Description ActivitySensor(android.content.Context appEnv)Creates a ActivitySensorActivitySensor(java.lang.String id, android.content.Context appEnv)Creates a ActivitySensorActivitySensor(java.lang.String id, android.content.Context appEnv, long interval)Creates a ActivitySensor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidstartUpdates()Starts receiving sensor data valuesvoidstopUpdates()Stops receiving sensor data values-
Methods inherited from class eu.h2020.helios_social.core.sensor.Sensor
finalize, getId, getSensorById, getValueListeners, receiveValue, registerValueListener, unregisterValueListener
-
-
-
-
Constructor Detail
-
ActivitySensor
public ActivitySensor(java.lang.String id, android.content.Context appEnv, long interval)Creates a ActivitySensor- Parameters:
id- the identifier of thisappEnv- the application envinterval- the detection interval
-
ActivitySensor
public ActivitySensor(java.lang.String id, android.content.Context appEnv)Creates a ActivitySensor- Parameters:
id- the identifier of thisappEnv- the application env
-
ActivitySensor
public ActivitySensor(android.content.Context appEnv)
Creates a ActivitySensor- Parameters:
appEnv- the application env
-
-
Method Detail
-
startUpdates
public void startUpdates()
Description copied from class:SensorStarts receiving sensor data values- Specified by:
startUpdatesin classSensor
-
stopUpdates
public void stopUpdates()
Description copied from class:SensorStops receiving sensor data values- Specified by:
stopUpdatesin classSensor
-
-