de.unikassel.android.sdcframework.devices
Class ProximityDevice
java.lang.Object
de.unikassel.android.sdcframework.devices.AbstractSensorDevice
de.unikassel.android.sdcframework.devices.ScannerStateAwareSensorDevice
de.unikassel.android.sdcframework.devices.AbstractAndroidSensorDevice
de.unikassel.android.sdcframework.devices.SamplingCausingAndroidSensorDevice
de.unikassel.android.sdcframework.devices.ProximityDevice
- All Implemented Interfaces:
- SampleProvidingSensorDevice, SensorDevice, VisitableDevice
public class ProximityDevice
- extends SamplingCausingAndroidSensorDevice
Implementation of the proximity sensor device.
Methods inherited from class de.unikassel.android.sdcframework.devices.AbstractSensorDevice |
accept, doHandleDeviceDisabledBySystem, doHandleDeviceEnabledBySystem, getConfiguration, getDeviceIdentifier, getScanner, isAirplaneModeOn, isDeviceScanningEnabled, onCreate, onDestroy, setDeviceIdentifier, setScanner, updateConfiguration |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
currentSampleData
private final ProximitySampleData currentSampleData
- The actual sample of the device, updated whenever the handler for sensor
changes is called
ProximityDevice
public ProximityDevice(Context context)
- Constructor
- Parameters:
context
- the context
getCurrentSampleData
protected final SampleData getCurrentSampleData()
- Description copied from class:
AbstractAndroidSensorDevice
- Getter for the current sample data
- Specified by:
getCurrentSampleData
in class AbstractAndroidSensorDevice
- Returns:
- the current sample data
update
protected boolean update(SensorEvent event)
- Description copied from class:
SamplingCausingAndroidSensorDevice
- Method to update the sensor data
- Specified by:
update
in class SamplingCausingAndroidSensorDevice
- Parameters:
event
- the sensor event to handle
- Returns:
- true if data have been updated, false otherwise
hasSample
public final boolean hasSample()
- Description copied from interface:
SampleProvidingSensorDevice
- Test method for a sample available
- Returns:
- true if a sample is available