Date post: | 13-Apr-2017 |
Category: |
Education |
Upload: | yucheng-jin |
View: | 504 times |
Download: | 1 times |
Android Sensor and Framework - AWARE
Yucheng Jin, Sven Charleer, Robin De CroonJoris Klerkx
Augment Human @ HCI 7 October 2015
SensorsHardware devices that measure the physical environment.
• Motion sensorsaccelerometers, gravity sensors, gyroscopes, etc.• Environmental sensorsbarometers, photometers, and thermometers.• Position sensorsGPS, orientation sensors and magnetometers.
Sensor FrameworkAccess sensors and and acquire raw sensor data.
Android Sensor Framework includes 3 abstract class 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
Sensor Framework - AWAREAWARE is an Android instrumentation framework for logging, sharing and reusing mobile context.
http://www.awareframework.com/
Overview of AWARE infrastructure
Ferreira, D., Kostakos, V., & Dey, A. K. (2015). AWARE: mobile context instrumentation framework. Frontiers in ICT, 2, 6.
Overview of AWARE client’s interfaces
Ferreira, D., Kostakos, V., & Dey, A. K. (2015). AWARE: mobile context instrumentation framework. Frontiers in ICT, 2, 6.
How to use AWARE in your app?• Create a AWARE pluginIt runs on top of the AWARE app, AWARE need to be installed beforehand.(template)http://www.awareframework.com/creating-a-new-aware-plugin/
• Creating a standalone applicationIt uses AWARE as a built-in library and leverages AWARE’s sensors’ and plugins’ APIs.
Creating a standalone application1. Adding AWARE as a
library to your project.
2. Overriding AWARE’s resources with your application’s resources.
3. Include AWARE’s ContentProviders inside your application.
4. Include AWARE’s plugins inside your application.(if need)
http://www.awareframework.com/creating-a-standalone-application/
Saving sensor data• Saving context data into a ContentProviderContentProvider can manage databases such as SQLite.
Sync data
Save data
http://www.awareframework.com/creating-a-context-provider/
class Plugin, onCreate()
Reading sensor dataTwo ways of reading data• Passive contextAccessing the data from the database when you need it• Active context- Listening to data changes- Listening to new values
http://www.awareframework.com/how-do-i-read-data/#read1
Passive contextAccessing the data from the database.
http://www.awareframework.com/how-do-i-read-data/#read1
Active contextReading new data from the database when it gets inserted
http://www.awareframework.com/how-do-i-read-data/#read1
In the class Plugin
Active contextReading the new data as it gets broadcasted by a sensor
http://www.awareframework.com/how-do-i-read-data/#read1
onCreate(), onResume()
In the class Plugin
onReceive()
Practice• AWAREFollow the link to create a standalone application with sensors or the plugin “Google Fused Location”http://www.awareframework.com/creating-a-standalone-application/#http://www.awareframework.com/plugin/82/ or create your own plugin http://www.awareframework.com/creating-a-new-aware-plugin/
More tutorialhttp://www.awareframework.com/category/tutorials/
• Original android sensor docModify 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
Thanks & Questions?