de.unikassel.android.sdcframework.devices
Class PassiveSampleTakingDeviceScanner
java.lang.Object
de.unikassel.android.sdcframework.util.ObservableEventSourceImpl<Sample>
de.unikassel.android.sdcframework.devices.AbstractSensorDeviceScanner
de.unikassel.android.sdcframework.devices.SampleTakingDeviceScanner
de.unikassel.android.sdcframework.devices.PassiveSampleTakingDeviceScanner
- All Implemented Interfaces:
- SensorDeviceScanner, ObservableEventSource<Sample>, ObserverRegistration<Sample>
- Direct Known Subclasses:
- LightDeviceScanner, ProximityDeviceScanner, TimeProviderDeviceScanner
public class PassiveSampleTakingDeviceScanner
- extends SampleTakingDeviceScanner
This is a base class for a passive sample taking device scanner, which does
ignore the sample frequency and is triggered by the associated device to for
sampling.
It does extend the sample taking device scanner to derive the
SampleTakingDeviceScanner.takeSample()
method, but overrides the start and stop methods to
avoid spawning a timer task.
It is intended to be used for the binary sensor types like light and
proximity, which does rarely generate events.
- See Also:
TemperatureDeviceScanner
,
LightDeviceScanner
,
ProximityDeviceScanner
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
PassiveSampleTakingDeviceScanner
public PassiveSampleTakingDeviceScanner()
- Constructor
start
public final boolean start(Context context)
- Description copied from interface:
SensorDeviceScanner
- Does start sampling
- Specified by:
start
in interface SensorDeviceScanner
- Overrides:
start
in class SampleTakingDeviceScanner
- Parameters:
context
- the application context
- Returns:
- true if successful started, false otherwise
stop
public final boolean stop(Context context)
- Description copied from interface:
SensorDeviceScanner
- Does stop sampling
- Specified by:
stop
in interface SensorDeviceScanner
- Overrides:
stop
in class SampleTakingDeviceScanner
- Parameters:
context
- the application context
- Returns:
- true if successful started, false otherwise