Peno sensor

10
Android Sensor Framework Yucheng Jin, Sven Charleer, Robin De Croon Joris Klerkx Augment Human @ HCI 7 October 2015

Transcript of Peno sensor

Page 1: Peno sensor

Android Sensor Framework

Yucheng Jin, Sven Charleer, Robin De CroonJoris Klerkx

Augment Human @ HCI 7 October 2015

Page 2: Peno sensor

SensorsHardware devices that measure the physical environment.

• Motion sensorsaccelerometers, gravity sensors, gyroscopes, etc.• Environmental sensorsbarometers, photometers, and thermometers.• Position sensorsGPS, orientation sensors and magnetometers.

Page 3: Peno sensor

Sensor FrameworkAccess sensors and and acquire raw sensor data.Android Sensor Framework includes three classes and one interface.

• SensorManager• Sensor• SensorEvent• SensorEventListener

http://developer.android.com/guide/topics/sensors/sensors_overview.html

• Identifying sensors and sensor capabilities• Monitor sensor events

Page 4: Peno sensor

SensorManager• Methods

Access the device's sensors

mSensorManager = (SensorManager)getSystemService(SENSOR_SERVICE);

mAccelerometer = mSensorManager.getDefaultSensor(Sensor.TYPE_ACCELEROMETER);

Registering and unregistering sensor event listeners

mSensorManager.registerListener(this, mAccelerometer, SensorManager.SENSOR_DELAY_NORMAL);

mSensorManager.unregisterListener(this);

• Constants

Sensor accuracy,

Set data acquisition rates

Calibrate sensors

http://developer.android.com/reference/android/hardware/SensorManager.html

Page 5: Peno sensor

SensorCreate an specific sensor object.

• Methods

Check a sensor's capabilities.

e.g. getStringType ()

• Constants

……

http://developer.android.com/reference/android/hardware/Sensor.html

Page 6: Peno sensor

SensorEventThis class represents a sensor event and holds information

such as the sensor's type, the time-stamp, accuracy and sensor's data.

• Methods

event.sensor.getType()

event.values[]• Constants

……

http://developer.android.com/reference/android/hardware/SensorEvent.html

Page 7: Peno sensor

SensorEventListenerReceiving notifications from the SensorManager when sensor values have changed.

such as the sensor's type, the time-stamp, accuracy and sensor's data.

• Methods

http://developer.android.com/reference/android/hardware/SensorEventListener.html

Page 8: Peno sensor
Page 9: Peno sensor

PracticeModify the app and show the actual values of listed sensors on your device.http://www.tutorialspoint.com/android/android_sensors.htmhttp://developer.android.com/guide/topics/sensors/sensors_overview.html

Page 10: Peno sensor

Thanks & Questions?