Pervasive Mobile Applications - Kursused · 2014-10-06 · Home assignment 2 •We already explored...
Transcript of Pervasive Mobile Applications - Kursused · 2014-10-06 · Home assignment 2 •We already explored...
![Page 2: Pervasive Mobile Applications - Kursused · 2014-10-06 · Home assignment 2 •We already explored the utilization of micromechanical sensors within the mobile applications –We](https://reader034.fdocuments.net/reader034/viewer/2022042300/5ecab97b4e865934646508bb/html5/thumbnails/2.jpg)
Outline
• What is mobile sensing?
• Mobile sensing technologies
• Development of smartphone sensing apps with Android
– Gesture and activity detection
• Next generation mobile sensing
– Event-based sensing through notifications
Huber Flores 2
![Page 3: Pervasive Mobile Applications - Kursused · 2014-10-06 · Home assignment 2 •We already explored the utilization of micromechanical sensors within the mobile applications –We](https://reader034.fdocuments.net/reader034/viewer/2022042300/5ecab97b4e865934646508bb/html5/thumbnails/3.jpg)
MOBILE SENSING
Huber Flores 3
![Page 4: Pervasive Mobile Applications - Kursused · 2014-10-06 · Home assignment 2 •We already explored the utilization of micromechanical sensors within the mobile applications –We](https://reader034.fdocuments.net/reader034/viewer/2022042300/5ecab97b4e865934646508bb/html5/thumbnails/4.jpg)
What is mobile sensing?
• Individual
– Gesture
– Activity
– Location
– Proximity
• Group
– Smart mobs
Huber Flores 4
Source: http://clout-project.eu/
![Page 5: Pervasive Mobile Applications - Kursused · 2014-10-06 · Home assignment 2 •We already explored the utilization of micromechanical sensors within the mobile applications –We](https://reader034.fdocuments.net/reader034/viewer/2022042300/5ecab97b4e865934646508bb/html5/thumbnails/5.jpg)
MOBILE SENSING TECHNOLOGIES
Huber Flores 5
![Page 6: Pervasive Mobile Applications - Kursused · 2014-10-06 · Home assignment 2 •We already explored the utilization of micromechanical sensors within the mobile applications –We](https://reader034.fdocuments.net/reader034/viewer/2022042300/5ecab97b4e865934646508bb/html5/thumbnails/6.jpg)
Integrated sensors
Huber Flores 6
Compass
Gesture
Orientation Positioning
Acceleration
![Page 7: Pervasive Mobile Applications - Kursused · 2014-10-06 · Home assignment 2 •We already explored the utilization of micromechanical sensors within the mobile applications –We](https://reader034.fdocuments.net/reader034/viewer/2022042300/5ecab97b4e865934646508bb/html5/thumbnails/7.jpg)
Integrated sensors: Accelerometer
Huber Flores 7
Source: Flores, H, et al. "Zompopo: mobile calendar prediction based on human activities recognition using the accelerometer and cloud services." IEEE NGMAST 2011.
![Page 8: Pervasive Mobile Applications - Kursused · 2014-10-06 · Home assignment 2 •We already explored the utilization of micromechanical sensors within the mobile applications –We](https://reader034.fdocuments.net/reader034/viewer/2022042300/5ecab97b4e865934646508bb/html5/thumbnails/8.jpg)
Integrated sensors: Magnetic field
Huber Flores 8
![Page 9: Pervasive Mobile Applications - Kursused · 2014-10-06 · Home assignment 2 •We already explored the utilization of micromechanical sensors within the mobile applications –We](https://reader034.fdocuments.net/reader034/viewer/2022042300/5ecab97b4e865934646508bb/html5/thumbnails/9.jpg)
Integrated sensors: Gyroscope
Huber Flores 9
![Page 10: Pervasive Mobile Applications - Kursused · 2014-10-06 · Home assignment 2 •We already explored the utilization of micromechanical sensors within the mobile applications –We](https://reader034.fdocuments.net/reader034/viewer/2022042300/5ecab97b4e865934646508bb/html5/thumbnails/10.jpg)
Integrated sensors: Barometer
Huber Flores 10
Source: Muralidharan, Kartik, et al. "Barometric phone sensors: more hype than hope!." Proceedings of the 15th Workshop on Mobile Computing Systems and Applications. ACM, 2014.
![Page 11: Pervasive Mobile Applications - Kursused · 2014-10-06 · Home assignment 2 •We already explored the utilization of micromechanical sensors within the mobile applications –We](https://reader034.fdocuments.net/reader034/viewer/2022042300/5ecab97b4e865934646508bb/html5/thumbnails/11.jpg)
Non-integrated sensors
Huber Flores 11
![Page 12: Pervasive Mobile Applications - Kursused · 2014-10-06 · Home assignment 2 •We already explored the utilization of micromechanical sensors within the mobile applications –We](https://reader034.fdocuments.net/reader034/viewer/2022042300/5ecab97b4e865934646508bb/html5/thumbnails/12.jpg)
Non-integrated sensors
Huber Flores 12
Microcontroller: Arduino Mega ADK
![Page 13: Pervasive Mobile Applications - Kursused · 2014-10-06 · Home assignment 2 •We already explored the utilization of micromechanical sensors within the mobile applications –We](https://reader034.fdocuments.net/reader034/viewer/2022042300/5ecab97b4e865934646508bb/html5/thumbnails/13.jpg)
Non-integrated sensors
Huber Flores 13
Wireless shield
Sensor shield
![Page 14: Pervasive Mobile Applications - Kursused · 2014-10-06 · Home assignment 2 •We already explored the utilization of micromechanical sensors within the mobile applications –We](https://reader034.fdocuments.net/reader034/viewer/2022042300/5ecab97b4e865934646508bb/html5/thumbnails/14.jpg)
Non-integrated sensors
Huber Flores 14
Wireless module Usb to serial converter
![Page 15: Pervasive Mobile Applications - Kursused · 2014-10-06 · Home assignment 2 •We already explored the utilization of micromechanical sensors within the mobile applications –We](https://reader034.fdocuments.net/reader034/viewer/2022042300/5ecab97b4e865934646508bb/html5/thumbnails/15.jpg)
Non-integrated sensors
Huber Flores 15
![Page 16: Pervasive Mobile Applications - Kursused · 2014-10-06 · Home assignment 2 •We already explored the utilization of micromechanical sensors within the mobile applications –We](https://reader034.fdocuments.net/reader034/viewer/2022042300/5ecab97b4e865934646508bb/html5/thumbnails/16.jpg)
DEVELOPMENT OF SMARTPHONE SENSING APPS
Huber Flores 16
![Page 17: Pervasive Mobile Applications - Kursused · 2014-10-06 · Home assignment 2 •We already explored the utilization of micromechanical sensors within the mobile applications –We](https://reader034.fdocuments.net/reader034/viewer/2022042300/5ecab97b4e865934646508bb/html5/thumbnails/17.jpg)
Mobile Sensing: Android
Huber Flores 17
![Page 18: Pervasive Mobile Applications - Kursused · 2014-10-06 · Home assignment 2 •We already explored the utilization of micromechanical sensors within the mobile applications –We](https://reader034.fdocuments.net/reader034/viewer/2022042300/5ecab97b4e865934646508bb/html5/thumbnails/18.jpg)
Mobile sensing: Android
• Gesture API
Huber Flores 18
![Page 19: Pervasive Mobile Applications - Kursused · 2014-10-06 · Home assignment 2 •We already explored the utilization of micromechanical sensors within the mobile applications –We](https://reader034.fdocuments.net/reader034/viewer/2022042300/5ecab97b4e865934646508bb/html5/thumbnails/19.jpg)
Mobile sensing: Android
• Start your Android emulator with Google APIs
• Download source code – https://github.com/huberflores/AndroidSensorSimula
tor.git
Huber Flores 19
![Page 20: Pervasive Mobile Applications - Kursused · 2014-10-06 · Home assignment 2 •We already explored the utilization of micromechanical sensors within the mobile applications –We](https://reader034.fdocuments.net/reader034/viewer/2022042300/5ecab97b4e865934646508bb/html5/thumbnails/20.jpg)
DEMO
Huber Flores 20
![Page 21: Pervasive Mobile Applications - Kursused · 2014-10-06 · Home assignment 2 •We already explored the utilization of micromechanical sensors within the mobile applications –We](https://reader034.fdocuments.net/reader034/viewer/2022042300/5ecab97b4e865934646508bb/html5/thumbnails/21.jpg)
Exercise
• Try gesture API
Huber Flores 21
![Page 22: Pervasive Mobile Applications - Kursused · 2014-10-06 · Home assignment 2 •We already explored the utilization of micromechanical sensors within the mobile applications –We](https://reader034.fdocuments.net/reader034/viewer/2022042300/5ecab97b4e865934646508bb/html5/thumbnails/22.jpg)
What about other sensors?
Huber Flores 22
![Page 23: Pervasive Mobile Applications - Kursused · 2014-10-06 · Home assignment 2 •We already explored the utilization of micromechanical sensors within the mobile applications –We](https://reader034.fdocuments.net/reader034/viewer/2022042300/5ecab97b4e865934646508bb/html5/thumbnails/23.jpg)
Mobile sensing: Android
• Physical device
• Android emulator?
• Sensor simulator?
Huber Flores 23
![Page 24: Pervasive Mobile Applications - Kursused · 2014-10-06 · Home assignment 2 •We already explored the utilization of micromechanical sensors within the mobile applications –We](https://reader034.fdocuments.net/reader034/viewer/2022042300/5ecab97b4e865934646508bb/html5/thumbnails/24.jpg)
Mobile sensing: Android
• Sensor simulator tool – Download and extract
• http://code.google.com/p/openintents/wiki/SensorSimulator (SensorSimulator 2.0-rc1.zip)
• Install app in Android emulator – $ adb # command in /android-sdk/platform-tools/
– $ adb install SensorSimulatorSettings-2.0-rc1.apk
• Execute sensor simulator – $ java –jar sensorsimulator-2.0-rc1.jar
– Set IP address in Android emulator
– Alternatively, this repository contains everything you need (https://github.com/huberflores/AndroidSensorSimulator.git)
Huber Flores 24
![Page 25: Pervasive Mobile Applications - Kursused · 2014-10-06 · Home assignment 2 •We already explored the utilization of micromechanical sensors within the mobile applications –We](https://reader034.fdocuments.net/reader034/viewer/2022042300/5ecab97b4e865934646508bb/html5/thumbnails/25.jpg)
Mobile sensing: Android
Huber Flores 25
![Page 26: Pervasive Mobile Applications - Kursused · 2014-10-06 · Home assignment 2 •We already explored the utilization of micromechanical sensors within the mobile applications –We](https://reader034.fdocuments.net/reader034/viewer/2022042300/5ecab97b4e865934646508bb/html5/thumbnails/26.jpg)
Mobile sensing: Android
Huber Flores 26
![Page 27: Pervasive Mobile Applications - Kursused · 2014-10-06 · Home assignment 2 •We already explored the utilization of micromechanical sensors within the mobile applications –We](https://reader034.fdocuments.net/reader034/viewer/2022042300/5ecab97b4e865934646508bb/html5/thumbnails/27.jpg)
Mobile sensing: Android
Huber Flores 27
![Page 28: Pervasive Mobile Applications - Kursused · 2014-10-06 · Home assignment 2 •We already explored the utilization of micromechanical sensors within the mobile applications –We](https://reader034.fdocuments.net/reader034/viewer/2022042300/5ecab97b4e865934646508bb/html5/thumbnails/28.jpg)
DEMO
Huber Flores 28
![Page 29: Pervasive Mobile Applications - Kursused · 2014-10-06 · Home assignment 2 •We already explored the utilization of micromechanical sensors within the mobile applications –We](https://reader034.fdocuments.net/reader034/viewer/2022042300/5ecab97b4e865934646508bb/html5/thumbnails/29.jpg)
Exercise
• Try and install sensor simulator
• Run accelerometer app
Huber Flores 29
![Page 30: Pervasive Mobile Applications - Kursused · 2014-10-06 · Home assignment 2 •We already explored the utilization of micromechanical sensors within the mobile applications –We](https://reader034.fdocuments.net/reader034/viewer/2022042300/5ecab97b4e865934646508bb/html5/thumbnails/30.jpg)
Mobile sensing: Android + Arduino
Huber Flores 30
![Page 31: Pervasive Mobile Applications - Kursused · 2014-10-06 · Home assignment 2 •We already explored the utilization of micromechanical sensors within the mobile applications –We](https://reader034.fdocuments.net/reader034/viewer/2022042300/5ecab97b4e865934646508bb/html5/thumbnails/31.jpg)
Mobile sensing: Android + Arduino
• Hardware requirements
– Accessory mode
• Usb cable
– Communication modules
• Wifi
• Bluetooth
Huber Flores 31
![Page 32: Pervasive Mobile Applications - Kursused · 2014-10-06 · Home assignment 2 •We already explored the utilization of micromechanical sensors within the mobile applications –We](https://reader034.fdocuments.net/reader034/viewer/2022042300/5ecab97b4e865934646508bb/html5/thumbnails/32.jpg)
Mobile sensing: Android + Arduino
• Software requirements (Development)
– Arduino IDE
• Sketch (C, C++)
– Hterm console
• Communication testing
Huber Flores 32
![Page 33: Pervasive Mobile Applications - Kursused · 2014-10-06 · Home assignment 2 •We already explored the utilization of micromechanical sensors within the mobile applications –We](https://reader034.fdocuments.net/reader034/viewer/2022042300/5ecab97b4e865934646508bb/html5/thumbnails/33.jpg)
Mobile sensing: Android + Arduino
Huber Flores 33
• Arduino side
![Page 34: Pervasive Mobile Applications - Kursused · 2014-10-06 · Home assignment 2 •We already explored the utilization of micromechanical sensors within the mobile applications –We](https://reader034.fdocuments.net/reader034/viewer/2022042300/5ecab97b4e865934646508bb/html5/thumbnails/34.jpg)
Mobile sensing: Android + Arduino
• Android side
– Add permissions to AndroidManifest.xml
– Implement data streaming communication
Huber Flores 34
![Page 35: Pervasive Mobile Applications - Kursused · 2014-10-06 · Home assignment 2 •We already explored the utilization of micromechanical sensors within the mobile applications –We](https://reader034.fdocuments.net/reader034/viewer/2022042300/5ecab97b4e865934646508bb/html5/thumbnails/35.jpg)
DEMO
Huber Flores 35
![Page 36: Pervasive Mobile Applications - Kursused · 2014-10-06 · Home assignment 2 •We already explored the utilization of micromechanical sensors within the mobile applications –We](https://reader034.fdocuments.net/reader034/viewer/2022042300/5ecab97b4e865934646508bb/html5/thumbnails/36.jpg)
NEXT GENERATION MOBILE SENSING
Huber Flores 36
![Page 37: Pervasive Mobile Applications - Kursused · 2014-10-06 · Home assignment 2 •We already explored the utilization of micromechanical sensors within the mobile applications –We](https://reader034.fdocuments.net/reader034/viewer/2022042300/5ecab97b4e865934646508bb/html5/thumbnails/37.jpg)
Next generation mobile sensing
Huber Flores 37
![Page 38: Pervasive Mobile Applications - Kursused · 2014-10-06 · Home assignment 2 •We already explored the utilization of micromechanical sensors within the mobile applications –We](https://reader034.fdocuments.net/reader034/viewer/2022042300/5ecab97b4e865934646508bb/html5/thumbnails/38.jpg)
Notification services
• Apple Push Notification Service (APNS)
• Microsoft Push Notification Service (MPNS)
• Google Cloud Messaging (GCM)
• Message Queuing Telemetry Transport (MQTT)
• Extensible Messaging and Presence Protocol (XMPP)
Huber Flores 38
![Page 39: Pervasive Mobile Applications - Kursused · 2014-10-06 · Home assignment 2 •We already explored the utilization of micromechanical sensors within the mobile applications –We](https://reader034.fdocuments.net/reader034/viewer/2022042300/5ecab97b4e865934646508bb/html5/thumbnails/39.jpg)
Notification services
Huber Flores 39
Source: Flores, H, et al. "Mobile cloud messaging supported by XMPP primitives." Proceeding of the fourth MobiSys workshop on Mobile cloud computing and services. ACM, 2013.
![Page 40: Pervasive Mobile Applications - Kursused · 2014-10-06 · Home assignment 2 •We already explored the utilization of micromechanical sensors within the mobile applications –We](https://reader034.fdocuments.net/reader034/viewer/2022042300/5ecab97b4e865934646508bb/html5/thumbnails/40.jpg)
Notification services
• Push gateway proxy
– Broker
– Subscribers
• Remote executions
• Polling (e.g. HTTP)
• Heartbeats
– Highly integrated and optimized algorithms
• Low resource consumption
Huber Flores 40
![Page 41: Pervasive Mobile Applications - Kursused · 2014-10-06 · Home assignment 2 •We already explored the utilization of micromechanical sensors within the mobile applications –We](https://reader034.fdocuments.net/reader034/viewer/2022042300/5ecab97b4e865934646508bb/html5/thumbnails/41.jpg)
Notification services
• Download source code – https://github.com/huberflores/GCMClient.git
• SENDER_ID = 66267873XXXX
• SERVER_URL = http://xxx.xxx.xxx.xxx:8080/GCM-
mavenized-server
• Server code (in case you want to try at home)
– https://github.com/huberflores/GCMServer.git
Huber Flores 41
![Page 42: Pervasive Mobile Applications - Kursused · 2014-10-06 · Home assignment 2 •We already explored the utilization of micromechanical sensors within the mobile applications –We](https://reader034.fdocuments.net/reader034/viewer/2022042300/5ecab97b4e865934646508bb/html5/thumbnails/42.jpg)
DEMO
Huber Flores 42
![Page 43: Pervasive Mobile Applications - Kursused · 2014-10-06 · Home assignment 2 •We already explored the utilization of micromechanical sensors within the mobile applications –We](https://reader034.fdocuments.net/reader034/viewer/2022042300/5ecab97b4e865934646508bb/html5/thumbnails/43.jpg)
Exercise
• Implement a notification client in Android
Huber Flores 43
![Page 44: Pervasive Mobile Applications - Kursused · 2014-10-06 · Home assignment 2 •We already explored the utilization of micromechanical sensors within the mobile applications –We](https://reader034.fdocuments.net/reader034/viewer/2022042300/5ecab97b4e865934646508bb/html5/thumbnails/44.jpg)
Next generation mobile sensing
• Participatory sensing
• Community sensing
• Mobile crowdsourcing
Huber Flores 44
![Page 45: Pervasive Mobile Applications - Kursused · 2014-10-06 · Home assignment 2 •We already explored the utilization of micromechanical sensors within the mobile applications –We](https://reader034.fdocuments.net/reader034/viewer/2022042300/5ecab97b4e865934646508bb/html5/thumbnails/45.jpg)
QUESTIONS?
Huber Flores 45
![Page 46: Pervasive Mobile Applications - Kursused · 2014-10-06 · Home assignment 2 •We already explored the utilization of micromechanical sensors within the mobile applications –We](https://reader034.fdocuments.net/reader034/viewer/2022042300/5ecab97b4e865934646508bb/html5/thumbnails/46.jpg)
References
• Suggested readings – Srirama, S; Flores, H; and et al. “Zompopo: mobile
calendar prediction based on human activities recognition using the accelerometer and cloud services“, NGMAST 2011, Oxford, UK, September 14-16.
– Arduino tutorial https://courses.cs.ut.ee/2013/MAD/fall/uploads/Main/ArduinoTutorialWithExample.zip
– Source code https://github.com/huberflores?tab=repositories
Huber Flores 46
![Page 47: Pervasive Mobile Applications - Kursused · 2014-10-06 · Home assignment 2 •We already explored the utilization of micromechanical sensors within the mobile applications –We](https://reader034.fdocuments.net/reader034/viewer/2022042300/5ecab97b4e865934646508bb/html5/thumbnails/47.jpg)
Home assignment 2
• We already explored the utilization of micromechanical sensors within the mobile applications – We will focus in the accelerometer
• You can use sensor emulator or a physical device for this homework – If you don’t have a device, we can provide you one, but
request it with anticipation
• Sensor emulator demonstration was provided along with some code for sensor simulator
• Sensor working code for a real device was also provided – It can be utilized as core if you find it usable, but you can
always code yours
Huber Flores 47
![Page 48: Pervasive Mobile Applications - Kursused · 2014-10-06 · Home assignment 2 •We already explored the utilization of micromechanical sensors within the mobile applications –We](https://reader034.fdocuments.net/reader034/viewer/2022042300/5ecab97b4e865934646508bb/html5/thumbnails/48.jpg)
Home assignment 2
Huber Flores 48
![Page 49: Pervasive Mobile Applications - Kursused · 2014-10-06 · Home assignment 2 •We already explored the utilization of micromechanical sensors within the mobile applications –We](https://reader034.fdocuments.net/reader034/viewer/2022042300/5ecab97b4e865934646508bb/html5/thumbnails/49.jpg)
Home assignment 2
Huber Flores 49
![Page 50: Pervasive Mobile Applications - Kursused · 2014-10-06 · Home assignment 2 •We already explored the utilization of micromechanical sensors within the mobile applications –We](https://reader034.fdocuments.net/reader034/viewer/2022042300/5ecab97b4e865934646508bb/html5/thumbnails/50.jpg)
Home assignment 2
• Object moves from left to right (and vice-versa) based on the orientation of the device
• A touch event makes the object to jump over an obstacle
Huber Flores 50