de.unikassel.android.sdcframework.devices.facade
Interface SensorDevice

Package class diagram package SensorDevice
All Superinterfaces:
VisitableDevice
All Known Subinterfaces:
SensorDeviceComposite
All Known Implementing Classes:
AbstractAndroidSensorDevice, AbstractLocationDevice, AbstractSensorDevice, AccelerometerDevice, AudioDevice, BluetoothDevice, GPSDevice, GSMDevice, GyroscopeDevice, LightDevice, MagneticFieldDevice, NetworkLocationDevice, OrientationDevice, PressureDevice, ProximityDevice, SamplingCausingAndroidSensorDevice, ScannerStateAwareSensorDevice, SystemBroadcastReceivingDevice, TagDevice, TemperatureDevice, TimeProviderDevice, TwitterDevice, VirtualSensorDevice, WifiDevice

public interface SensorDevice
extends VisitableDevice

Interface for any sensor device type.


Method Summary
 void doHandleDeviceDisabledBySystem(Context context)
          Default handler for the fact, the system device state is changing from enabled to disabled.
 void doHandleDeviceEnabledBySystem(Context context)
          Default handler for the fact, the system device state is changing from disabled to enabled.
 boolean enableDeviceScanning(boolean enabled, Context context)
          Setter for device scanning enabled state
 SensorDeviceConfiguration getConfiguration()
          Getter for the sensor device configuration
 SensorDeviceIdentifier getDeviceIdentifier()
          Getter for the sensors device identifier
 SensorDeviceScanner getScanner()
          Getter for the scanner
 boolean isDeviceInSystemEnabled(Context context)
          Test method for the system wide enabled state of the device
 boolean isDeviceScanningEnabled()
          Getter for device scanning enabled state in the framework
 void onCreate(Context context)
          Is called when this device is created
 void onDestroy(Context context)
          Is called when the owner destroys this device
 void setScanner(SensorDeviceScanner scanner, Context context)
          Setter for the scanner
 void updateConfiguration(SensorDeviceConfiguration configuration, Context context)
          Update method for the device configuration settings
 
Methods inherited from interface de.unikassel.android.sdcframework.devices.facade.VisitableDevice
accept
 

Method Detail

getDeviceIdentifier

SensorDeviceIdentifier getDeviceIdentifier()
Getter for the sensors device identifier

Returns:
the sensor device identifier

isDeviceScanningEnabled

boolean isDeviceScanningEnabled()
Getter for device scanning enabled state in the framework

Returns:
true if the device scanning is enabled, false otherwise

enableDeviceScanning

boolean enableDeviceScanning(boolean enabled,
                             Context context)
Setter for device scanning enabled state

Parameters:
enabled - true to enable device scanning, false to disable it
context - the application context
Returns:
true if successful enabled, false otherwise

updateConfiguration

void updateConfiguration(SensorDeviceConfiguration configuration,
                         Context context)
Update method for the device configuration settings

Parameters:
configuration - the device configuration
context - the application context

setScanner

void setScanner(SensorDeviceScanner scanner,
                Context context)
Setter for the scanner

Parameters:
scanner - the scanner to set
context - the application context

getScanner

SensorDeviceScanner getScanner()
Getter for the scanner

Returns:
the scanner

getConfiguration

SensorDeviceConfiguration getConfiguration()
Getter for the sensor device configuration

Returns:
the sensor device configuration

isDeviceInSystemEnabled

boolean isDeviceInSystemEnabled(Context context)
Test method for the system wide enabled state of the device

Parameters:
context - the application context
Returns:
true if device is enabled in system, false otherwise

doHandleDeviceEnabledBySystem

void doHandleDeviceEnabledBySystem(Context context)
Default handler for the fact, the system device state is changing from disabled to enabled.
If the device is enabled in the framework than the device scanner will be started.
A sensor device can call this method to proper handle the device is enabled case.

Parameters:
context - the application context

doHandleDeviceDisabledBySystem

void doHandleDeviceDisabledBySystem(Context context)
Default handler for the fact, the system device state is changing from enabled to disabled.
If the device is enabled in the framework and we are not in airplane mode, than this handler is signaling the user that the device is needed but disabled in the system. If the device scanner was running, it will be stopped.
A sensor device can call this method to proper handle the device is disabled case.

Parameters:
context - the application context

onCreate

void onCreate(Context context)
Is called when this device is created

Parameters:
context - the application context

onDestroy

void onDestroy(Context context)
Is called when the owner destroys this device

Parameters:
context - the application context