SlideShare uma empresa Scribd logo
1 de 50
Making Sense
The Road to mobile Awareness
• Jared Sheehan
• Twitter: @jayroo5245
• meetup.com/DCAndroid
• slideshare.net/Jayroo5245
• What is Contextual
Awareness?
• Use Cases
• Sensor Fusion
• Hard way
• Medium hard way
• Easy way
• Questions
Agenda
“Context is any information that can be used to
characterize the situation of an entity. An entity is
a person, place, or object that is considered
relevant to the interaction between a user and an
application, including the user and application
themselves. ”
• Anind Dey
• Director of Human-Computer
interaction at Carnegie Mellon
University
• Mobile sensing of a user’s context
• Sensor based algorithms
• Some Sensor Types on the Android
Platform
• Accelerometer
• Gyroscope/Orientation/Rotation
Vector
• Barometric Pressure
• Magnetic Field
• Gravity
• Relative Humidity
• Ambient Room Temperature
• Device Temperature
Mobile Contextual Awareness
Sensor Types in Android
• Detecting when a user:
• Changes the orientation of a
their device
• walking, running or biking
• Driving a vehicle
• Handling their device
• Driving AND Handling their
device
• Disclaimer – Don’t do it
• Drives by a restaurant or coffee
shop when it is open
• Driving detection
• Google Places
• Time
Use Cases
Sensor fusion is combining of
sensory data or data derived
from disparate sources such
that the resulting information
has less uncertainty than
would be possible when
these sources were used
individually.
Sensor Fusion – What is it?
If a developer takes
individual sensor output
and combines it with
additional output from
other sensors (or other
hints) then you get a
better understanding of
what is going on with the
mobile device.
Sensor Fusion – What is it?
Determine the attitude of a
mobile device.
Attitude - orientation of a
device relative to Earth's
horizon
Sensor Fusion – Example
The common way to get the
attitude of an Android
device is to use the
SensorManager.getOrientati
on() method to get the three
orientation angles. These
two angles are based on the
accelerometer and
magnetometer output.
Sensor Fusion – Example
In simple terms, the
accelerometer provides the
gravity vector (the vector
pointing towards the center
of the earth) and the
magnetometer works as a
compass. The Information
from both sensors suffice to
calculate the device’s
orientation.
Sensor Fusion – Example
Isn’t that enough?
Sensor Fusion – Example
No
Problem is that both sensor
outputs are inaccurate,
especially the output from the
magnetic field sensor which
includes a lot of noise.
How do we fix it?
Gyro drift and noisy orientation
are common issues with this
approach, to solve it, the
gyroscope output is applied
only for orientation changes in
short time intervals. While the
magnetometer/accelerometer
data is used as support
information over long periods
of time.
Sensor Fusion – Example
This is equivalent to low-pass
filtering of the accelerometer
and magnetic field sensor
signals and high-pass filtering
of the gyroscope signals. The
overall sensor fusion and
filtering looks like this:
Sensor Fusion – Example
Sensor Fusion – Example
So what exactly does high-pass
and low-pass filtering of the
sensor data mean? The sensors
provide their data at (more or
less) regular time intervals.
Their values can be shown as
signals in a graph with the time
as the x-axis, similar to an
audio signal.
Sensor Fusion – Example
The low-pass filtering of the
noisy
accelerometer/magnetometer
signal (accMagOrientationin
the above figure) are
orientation angles averaged
over time within a constant
time window.
Sensor Fusion – Example
Initialize sensor
containers:
Sensor Fusion – Example
Register you listeners:
Sensor Fusion – Example
Store sensor events:
Sensor Fusion – Example
At some time interval you
process the sensor arrays and
then events can be inferred
from a single or multiple
passes.
Sensor Fusion – Example
Example of Rotation Vector
processing:
https://developer.android.com
/reference/android/hardware/
SensorEvent.html#values
Sensor Fusion – Example
• https://github.com/Jayroo5245/mak
ingsense
• https://github.com/Jayroo5245
Demo time!
• This is a simple-ish formula to
obtain one feature
• Very large task
• Lots of math, calculations,
sensor state maintenance
• Not something a standard
Android developer is used to
working with
Sensor Fusion – Challenges
• How do you support 100% of
devices?
• Very difficult
• Android Fragmentation
• Not all sensors return values
at the same frequency
Sensor Fusion – Challenges
• Process prioritization issues
• OEMs build devices to
their specs, not ours
• Missing sensors on some
devices.
• Android/Java platform
limitations
• Go Native - NDK
Sensor Fusion – Challenges
Example Platform limitation:
The Android Platform was not
designed to process sensor
data as fast as it is generated.
Using an Executor had the best
results but you will not get
consistent 16, 32 or 64 hertz.
Sensor Fusion – Challenges
• External Libraries
• Lost - Drop in Replacement for
Google’s Fused Location API
• www.zendrive.com
• www.driversiti.com
• www.pathsense.com
• www.locationkit.io
Alternatives to the hard way:
• External Libraries
• Licensing – IE Cost
• Probably don’t do exactly
what you want
• Inference
Change/Deprecation
• lack support
• Battery Drain
Drawbacks to External Libs:
Battery Issues:
Let Google Do It for you – Awareness API
• Current Local Time
Context #1– Time
• Latitude
• Longitude
Context #2 – Location
• Place, including place Type
Context #3 – Place
• Activity Recognition
• Detected user activity
(walking, running, biking)
Context #4 – Activity
• Nearby beacons (including
namespace, type, and
content)
Context #5 – Beacons
• Are the Headphones plugged?
Context #6 – Headphones
• Current Weather Conditions
Context #7 – Weather
• Apps can combine these
context signals to make
inferences about the
user's current situation,
and use this information
to provide customized
experiences.
• Exp: Suggest a playlist
while jogging in the
rain.
What is it?
• Easy implementation
• One API
• Signals are processed
for the app
• No need to build
complicated
algorithms
• Optimized Battery
Awareness Benefits
• Fence API
• System Notifications
• Snapshot API
• Real time request
Great now what?
• Push Mechanism - React to
specific situations
• Provides notifications
when a specific
combination of actions
occur
• Exp: Tell me when a user is
biking, its lunchtime and
near a bike friendly
restaurant
Fence API
• Pull mechanism
• Provides notifications
when a specific
combination of actions
occur
• Exp: Tell me when a user is
biking, its lunchtime and
near a bike friendly
restaurant
Snapshot API
• Hard way
• Build your own
• Easier Way
• External Lib
• Easiest Way
• Awareness API
Three options
Thank you for coming!
The Road to mobile Awareness
• Jared Sheehan
• Twitter: @jayroo5245
• meetup.com/DCAndroid
• slideshare.net/Jayroo5245
Sources
• https://en.wikipedia.org/wiki/Sensor_fusion
• https://developer.android.com/guide/topics/sensors/sensors_overview.html
• http://plaw.info/2012/03/android-sensor-fusion-tutorial/comment-page-1/
• http://www.androidpolice.com/2016/05/19/the-new-awareness-api-will-let-
apps-better-understand-your-environment/
• https://developers.google.com/awareness/overview
• https://www.interaction-design.org/literature/book/the-encyclopedia-of-
human-computer-interaction-2nd-ed/context-aware-computing-context-
awareness-context-aware-user-interfaces-and-implicit-interaction

Mais conteúdo relacionado

Semelhante a Making sense

Human Activity Recognition in Android
Human Activity Recognition in AndroidHuman Activity Recognition in Android
Human Activity Recognition in AndroidSurbhi Jain
 
[EUC2014] cODA: An Open-Source Framework to Easily Design Context-Aware Andro...
[EUC2014] cODA: An Open-Source Framework to Easily Design Context-Aware Andro...[EUC2014] cODA: An Open-Source Framework to Easily Design Context-Aware Andro...
[EUC2014] cODA: An Open-Source Framework to Easily Design Context-Aware Andro...Matteo Ferroni
 
Wearable Computing - Part II: Sensors
Wearable Computing - Part II: SensorsWearable Computing - Part II: Sensors
Wearable Computing - Part II: SensorsDaniel Roggen
 
Mobile user experience conference 2009 - The rise of the mobile context
Mobile user experience conference 2009 - The rise of the mobile contextMobile user experience conference 2009 - The rise of the mobile context
Mobile user experience conference 2009 - The rise of the mobile contextFlorent Stroppa
 
From Context-awareness to Human Behavior Patterns
From Context-awareness to Human Behavior PatternsFrom Context-awareness to Human Behavior Patterns
From Context-awareness to Human Behavior PatternsVille Antila
 
Data, Big Data and real time analytics for Connected Devices
Data, Big Data and real time analytics for Connected DevicesData, Big Data and real time analytics for Connected Devices
Data, Big Data and real time analytics for Connected DevicesSrinath Perera
 
Abnormality in Elderly Fall using Android Smartphone
Abnormality in Elderly Fall using Android SmartphoneAbnormality in Elderly Fall using Android Smartphone
Abnormality in Elderly Fall using Android SmartphoneShivi Tandon
 
Sensors, threats, responses and challenges - Dr Emil Lupu (Imperial College L...
Sensors, threats, responses and challenges - Dr Emil Lupu (Imperial College L...Sensors, threats, responses and challenges - Dr Emil Lupu (Imperial College L...
Sensors, threats, responses and challenges - Dr Emil Lupu (Imperial College L...Comit Projects Ltd
 
Tizen Apps with Contextual Awareness, powered by AI
Tizen Apps with Contextual Awareness, powered by AI Tizen Apps with Contextual Awareness, powered by AI
Tizen Apps with Contextual Awareness, powered by AI Shashwat Pradhan
 
Smartphone sensor and gesture
Smartphone sensor and gestureSmartphone sensor and gesture
Smartphone sensor and gestureBhavya5800
 
Citron : Context Information Acquisition Framework on Personal Devices
Citron : Context Information Acquisition Framework on Personal DevicesCitron : Context Information Acquisition Framework on Personal Devices
Citron : Context Information Acquisition Framework on Personal DevicesTetsuo Yamabe
 
Behaviometrics: Behavior Modeling from Heterogeneous Sensory Time-Series
Behaviometrics: Behavior Modeling from Heterogeneous Sensory Time-SeriesBehaviometrics: Behavior Modeling from Heterogeneous Sensory Time-Series
Behaviometrics: Behavior Modeling from Heterogeneous Sensory Time-SeriesJiang Zhu
 
Artificial intelligence (AI) + Sensors + Aeronautics
Artificial intelligence (AI) + Sensors + AeronauticsArtificial intelligence (AI) + Sensors + Aeronautics
Artificial intelligence (AI) + Sensors + Aeronauticswaleed zahid kayani
 
Android Programming Basic
Android Programming BasicAndroid Programming Basic
Android Programming BasicDuy Do Phan
 

Semelhante a Making sense (20)

Human Activity Recognition in Android
Human Activity Recognition in AndroidHuman Activity Recognition in Android
Human Activity Recognition in Android
 
[EUC2014] cODA: An Open-Source Framework to Easily Design Context-Aware Andro...
[EUC2014] cODA: An Open-Source Framework to Easily Design Context-Aware Andro...[EUC2014] cODA: An Open-Source Framework to Easily Design Context-Aware Andro...
[EUC2014] cODA: An Open-Source Framework to Easily Design Context-Aware Andro...
 
Sensors 9
Sensors   9Sensors   9
Sensors 9
 
Sensor's inside
Sensor's insideSensor's inside
Sensor's inside
 
Wearable Computing - Part II: Sensors
Wearable Computing - Part II: SensorsWearable Computing - Part II: Sensors
Wearable Computing - Part II: Sensors
 
Mobile user experience conference 2009 - The rise of the mobile context
Mobile user experience conference 2009 - The rise of the mobile contextMobile user experience conference 2009 - The rise of the mobile context
Mobile user experience conference 2009 - The rise of the mobile context
 
From Context-awareness to Human Behavior Patterns
From Context-awareness to Human Behavior PatternsFrom Context-awareness to Human Behavior Patterns
From Context-awareness to Human Behavior Patterns
 
Data, Big Data and real time analytics for Connected Devices
Data, Big Data and real time analytics for Connected DevicesData, Big Data and real time analytics for Connected Devices
Data, Big Data and real time analytics for Connected Devices
 
Generic sensors for the Web
Generic sensors for the WebGeneric sensors for the Web
Generic sensors for the Web
 
Abnormality in Elderly Fall using Android Smartphone
Abnormality in Elderly Fall using Android SmartphoneAbnormality in Elderly Fall using Android Smartphone
Abnormality in Elderly Fall using Android Smartphone
 
Sensors, threats, responses and challenges - Dr Emil Lupu (Imperial College L...
Sensors, threats, responses and challenges - Dr Emil Lupu (Imperial College L...Sensors, threats, responses and challenges - Dr Emil Lupu (Imperial College L...
Sensors, threats, responses and challenges - Dr Emil Lupu (Imperial College L...
 
Tizen Apps with Contextual Awareness, powered by AI
Tizen Apps with Contextual Awareness, powered by AI Tizen Apps with Contextual Awareness, powered by AI
Tizen Apps with Contextual Awareness, powered by AI
 
Smartphone sensor and gesture
Smartphone sensor and gestureSmartphone sensor and gesture
Smartphone sensor and gesture
 
Contextual apps for Tizen
Contextual apps for TizenContextual apps for Tizen
Contextual apps for Tizen
 
Citron : Context Information Acquisition Framework on Personal Devices
Citron : Context Information Acquisition Framework on Personal DevicesCitron : Context Information Acquisition Framework on Personal Devices
Citron : Context Information Acquisition Framework on Personal Devices
 
Ubiq week1
Ubiq week1Ubiq week1
Ubiq week1
 
Behaviometrics: Behavior Modeling from Heterogeneous Sensory Time-Series
Behaviometrics: Behavior Modeling from Heterogeneous Sensory Time-SeriesBehaviometrics: Behavior Modeling from Heterogeneous Sensory Time-Series
Behaviometrics: Behavior Modeling from Heterogeneous Sensory Time-Series
 
Artificial intelligence (AI) + Sensors + Aeronautics
Artificial intelligence (AI) + Sensors + AeronauticsArtificial intelligence (AI) + Sensors + Aeronautics
Artificial intelligence (AI) + Sensors + Aeronautics
 
Android Programming Basic
Android Programming BasicAndroid Programming Basic
Android Programming Basic
 
NSBudapest Presentation
NSBudapest PresentationNSBudapest Presentation
NSBudapest Presentation
 

Último

DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamUiPathCommunity
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Victor Rentea
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...apidays
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Orbitshub
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdfSandro Moreira
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodJuan lago vázquez
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Jeffrey Haguewood
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelDeepika Singh
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontologyjohnbeverley2021
 

Último (20)

DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 

Making sense

  • 1. Making Sense The Road to mobile Awareness • Jared Sheehan • Twitter: @jayroo5245 • meetup.com/DCAndroid • slideshare.net/Jayroo5245
  • 2. • What is Contextual Awareness? • Use Cases • Sensor Fusion • Hard way • Medium hard way • Easy way • Questions Agenda
  • 3. “Context is any information that can be used to characterize the situation of an entity. An entity is a person, place, or object that is considered relevant to the interaction between a user and an application, including the user and application themselves. ” • Anind Dey • Director of Human-Computer interaction at Carnegie Mellon University
  • 4. • Mobile sensing of a user’s context • Sensor based algorithms • Some Sensor Types on the Android Platform • Accelerometer • Gyroscope/Orientation/Rotation Vector • Barometric Pressure • Magnetic Field • Gravity • Relative Humidity • Ambient Room Temperature • Device Temperature Mobile Contextual Awareness
  • 5. Sensor Types in Android
  • 6. • Detecting when a user: • Changes the orientation of a their device • walking, running or biking • Driving a vehicle • Handling their device • Driving AND Handling their device • Disclaimer – Don’t do it • Drives by a restaurant or coffee shop when it is open • Driving detection • Google Places • Time Use Cases
  • 7. Sensor fusion is combining of sensory data or data derived from disparate sources such that the resulting information has less uncertainty than would be possible when these sources were used individually. Sensor Fusion – What is it?
  • 8. If a developer takes individual sensor output and combines it with additional output from other sensors (or other hints) then you get a better understanding of what is going on with the mobile device. Sensor Fusion – What is it?
  • 9.
  • 10. Determine the attitude of a mobile device. Attitude - orientation of a device relative to Earth's horizon Sensor Fusion – Example
  • 11.
  • 12. The common way to get the attitude of an Android device is to use the SensorManager.getOrientati on() method to get the three orientation angles. These two angles are based on the accelerometer and magnetometer output. Sensor Fusion – Example
  • 13. In simple terms, the accelerometer provides the gravity vector (the vector pointing towards the center of the earth) and the magnetometer works as a compass. The Information from both sensors suffice to calculate the device’s orientation. Sensor Fusion – Example
  • 14. Isn’t that enough? Sensor Fusion – Example No Problem is that both sensor outputs are inaccurate, especially the output from the magnetic field sensor which includes a lot of noise. How do we fix it?
  • 15. Gyro drift and noisy orientation are common issues with this approach, to solve it, the gyroscope output is applied only for orientation changes in short time intervals. While the magnetometer/accelerometer data is used as support information over long periods of time. Sensor Fusion – Example
  • 16. This is equivalent to low-pass filtering of the accelerometer and magnetic field sensor signals and high-pass filtering of the gyroscope signals. The overall sensor fusion and filtering looks like this: Sensor Fusion – Example
  • 17. Sensor Fusion – Example
  • 18. So what exactly does high-pass and low-pass filtering of the sensor data mean? The sensors provide their data at (more or less) regular time intervals. Their values can be shown as signals in a graph with the time as the x-axis, similar to an audio signal. Sensor Fusion – Example
  • 19. The low-pass filtering of the noisy accelerometer/magnetometer signal (accMagOrientationin the above figure) are orientation angles averaged over time within a constant time window. Sensor Fusion – Example
  • 21. Register you listeners: Sensor Fusion – Example
  • 22. Store sensor events: Sensor Fusion – Example
  • 23. At some time interval you process the sensor arrays and then events can be inferred from a single or multiple passes. Sensor Fusion – Example
  • 24. Example of Rotation Vector processing: https://developer.android.com /reference/android/hardware/ SensorEvent.html#values Sensor Fusion – Example
  • 26. • This is a simple-ish formula to obtain one feature • Very large task • Lots of math, calculations, sensor state maintenance • Not something a standard Android developer is used to working with Sensor Fusion – Challenges
  • 27. • How do you support 100% of devices? • Very difficult • Android Fragmentation • Not all sensors return values at the same frequency Sensor Fusion – Challenges
  • 28. • Process prioritization issues • OEMs build devices to their specs, not ours • Missing sensors on some devices. • Android/Java platform limitations • Go Native - NDK Sensor Fusion – Challenges
  • 29. Example Platform limitation: The Android Platform was not designed to process sensor data as fast as it is generated. Using an Executor had the best results but you will not get consistent 16, 32 or 64 hertz. Sensor Fusion – Challenges
  • 30.
  • 31. • External Libraries • Lost - Drop in Replacement for Google’s Fused Location API • www.zendrive.com • www.driversiti.com • www.pathsense.com • www.locationkit.io Alternatives to the hard way:
  • 32. • External Libraries • Licensing – IE Cost • Probably don’t do exactly what you want • Inference Change/Deprecation • lack support • Battery Drain Drawbacks to External Libs:
  • 34.
  • 35. Let Google Do It for you – Awareness API
  • 36. • Current Local Time Context #1– Time
  • 38. • Place, including place Type Context #3 – Place
  • 39. • Activity Recognition • Detected user activity (walking, running, biking) Context #4 – Activity
  • 40. • Nearby beacons (including namespace, type, and content) Context #5 – Beacons
  • 41. • Are the Headphones plugged? Context #6 – Headphones
  • 42. • Current Weather Conditions Context #7 – Weather
  • 43. • Apps can combine these context signals to make inferences about the user's current situation, and use this information to provide customized experiences. • Exp: Suggest a playlist while jogging in the rain. What is it?
  • 44. • Easy implementation • One API • Signals are processed for the app • No need to build complicated algorithms • Optimized Battery Awareness Benefits
  • 45. • Fence API • System Notifications • Snapshot API • Real time request Great now what?
  • 46. • Push Mechanism - React to specific situations • Provides notifications when a specific combination of actions occur • Exp: Tell me when a user is biking, its lunchtime and near a bike friendly restaurant Fence API
  • 47. • Pull mechanism • Provides notifications when a specific combination of actions occur • Exp: Tell me when a user is biking, its lunchtime and near a bike friendly restaurant Snapshot API
  • 48. • Hard way • Build your own • Easier Way • External Lib • Easiest Way • Awareness API Three options
  • 49. Thank you for coming! The Road to mobile Awareness • Jared Sheehan • Twitter: @jayroo5245 • meetup.com/DCAndroid • slideshare.net/Jayroo5245
  • 50. Sources • https://en.wikipedia.org/wiki/Sensor_fusion • https://developer.android.com/guide/topics/sensors/sensors_overview.html • http://plaw.info/2012/03/android-sensor-fusion-tutorial/comment-page-1/ • http://www.androidpolice.com/2016/05/19/the-new-awareness-api-will-let- apps-better-understand-your-environment/ • https://developers.google.com/awareness/overview • https://www.interaction-design.org/literature/book/the-encyclopedia-of- human-computer-interaction-2nd-ed/context-aware-computing-context- awareness-context-aware-user-interfaces-and-implicit-interaction

Notas do Editor

  1. DCAndroid, Slideshare. I know you are all thrilled for my talk.
  2. No no, not like an iOS users attitude