SlideShare une entreprise Scribd logo
1  sur  28
Sensing Mobile Devices
and what it means for app developers
InfoQ.com: News & Community Site
• 750,000 unique visitors/month
• Published in 4 languages (English, Chinese, Japanese and Brazilian
Portuguese)
• Post content from our QCon conferences
• News 15-20 / week
• Articles 3-4 / week
• Presentations (videos) 12-15 / week
• Interviews 2-3 / week
• Books 1 / month
Watch the video with slide
synchronization on InfoQ.com!
http://www.infoq.com/presentations
/mobile-smartphone-sensors
Presented at QCon London
www.qconlondon.com
Purpose of QCon
- to empower software development by facilitating the spread of
knowledge and innovation
Strategy
- practitioner-driven conference designed for YOU: influencers of
change and innovation in your teams
- speakers and topics driving the evolution and innovation
- connecting and catalyzing the influencers and innovators
Highlights
- attended by more than 12,000 delegates since 2007
- held in 9 cities worldwide
Why the “Sensory Smartphone”?
 Smartphones are becoming more and more
powerful
 And near ubiquitous
 They are adding all the capabilities that we
have as sensing human
 And augmenting them in ways that humans
don’t have
Developments in Sensory Smartphones
 Accelerometer/Gyroscope
 Magnetometer
 Locationing
 Ambient light
 Ambient temperature
 Air pressure
 Proximity
 Humidity
 Force Sensitivity
Accelerometer/Gyroscope
 Accelerometer
 acceleration as three values (x,y,z axes) in m/s2
 almost every smartphone has one now
 Gyroscope
 acceleration as three values (x,y,z axes) in radians/s2
 can be done with accelerometer and magnetometer but not as
smooth
 iPhones and most highend Android devices have gyroscopes
Accelerometer/Magnetometer
for Real World Coordinates
if(SensorManager.getRotationMatrix(R, null, AccelerometerValues_last,
MagneticFieldValues_last))
{
SensorManager.remapCoordinateSystem(R, SensorManager.AXIS_Y,
SensorManager.AXIS_MINUS_X, remapR);
SensorManager.getOrientation(remapR, orientationValues);
Matrix.multiplyMV(orientationVector, 0, remapR, 0, sZVector, 0);
pitch = (float) (-Math.atan2(orientationVector[1], orientationVector[2]) *
RADIANS_TO_DEGREES);
orientation = (float) (-Math.atan2(orientationVector[0], orientationVector[1]) *
RADIANS_TO_DEGREES);
Matrix.invertM(remapR_inv, 0, remapR, 0);
Matrix.multiplyMV(azimuthVector, 0, remapR_inv, 0, sZVector, 0);
azimuth = (float) (180 + Math.atan2(azimuthVector[0], azimuthVector[1]) *
RADIANS_TO_DEGREES);
}
Hierarchy of Location Capabilities
 GPS
 Precision of 20-50m
 3 satellites for 2D fix, 4 satellites for 3D fix
 Doesn’t work indoors, drains battery
 Cell tower triangulation
 Wifi network triangulation
 Indoor locationing
 RFID
 Extended Large Tag NFC
Indoor Locationing Techniques
 Wifi/WLAN
 WLAN “fingerprinting” makes it more accurate (database of Wifi signature data)
 Often in combination with indoor maps
 Bluetooth
 Range: 10-30m, precision 5-10m (many access points required)
 Bluetooth 4 on most devices (must be set to visible)
 RFID
 Up to 200m range
 UWB
 High precision (<0.3m), high data rates, low energy
 Not in smartphones yet , high cost
 Zigbee
 Same underlying technology as UWB, not available directly on smartphones today
 Ultrasound
 High precision (~1cm), lots of sensors, vulnerable to interference
 IR
 Requires line of sight, very high precision (~1mm), superceded by other technologies
Ambient Light Sensors
 Implemented as multiple photodiodes
 Saves smartphone power by optimizing
brightness
 Reduces eyestrain
 Not really used in apps today
 Except indirectly
Ambient Light Sensor Code
public class AndroidLightSensorActivity extends Activity {
public void onCreate(Bundle savedInstanceState) {
SensorManager sensorManager = (SensorManager)getSystemService(Context.SENSOR_SERVICE);
Sensor lightSensor = sensorManager.getDefaultSensor(Sensor.TYPE_LIGHT);
if (lightSensor == null){
Toast.makeText(AndroidLightSensorActivity.this,
"No Light Sensor! quit-",
Toast.LENGTH_LONG).show();
}else{
float max = lightSensor.getMaximumRange();
lightMeter.setMax((int)max);
textMax.setText("Max Reading: " + String.valueOf(max));
sensorManager.registerListener(lightSensorEventListener,
lightSensor,
SensorManager.SENSOR_DELAY_NORMAL);
}
}
SensorEventListener lightSensorEventListener
= new SensorEventListener(){
public void onSensorChanged(SensorEvent event) {
if(event.sensor.getType()==Sensor.TYPE_LIGHT){
float currentReading = event.values[0];
lightMeter.setProgress((int)currentReading);
textReading.setText("Current Reading: " + String.valueOf(currentReading));
}
}
};
Ambient Temperature
 Temperature measures battery temperature and is available on most
devices
 But its deprecated as of Android 4.0
 Ambient Temperature measures ambient air temperature
 new in Android 4.0 (Ice Cream Sandwich)
 Few devices today
 Arrows Z ISW13F
 But Sensirion has ambient temperature/humidity chip
Relative Humidity
 Combined with ambient temperature get dew point:
ln(RH/100%) + m·t/(Tn+t)
td(t,RH) = Tn · ------------------------------------
m - [ln(RH/100%) + m·t/(Tn+t)]
 Absolute humidity
(RH/100%) · A · exp(m·t/(Tn+t)
dv(t,RH) = 216.7 · ------------------------------------
273.15 + t
Ambient Air Pressure
 Barometer showing up on more and more devices
 Xperia Active. Xperia Go. Galaxy S3. Galaxy Nexus. Galaxy Note. Galaxy Note2.
Motorola Xoom
 Provides altitude information WITHOUT GPS
 Accelerates GPS calculations as it provides first cut guess at altitude
before satellite fix
 Predicting impending storms when out in the field
 See Barometer and Altimeter apps on Google Play
Proximity
 On Android, returns number of centimeters distant
 Not exposed on iPhone formally (but some apps use it anyway)
 Most often implemented on Android as light sensor
 Specifically ISL29003/23 or GP2A chip
 Note that most sensors return only “near” or “far” (high or low) values
public void onSensorChanged(SensorEvent event) {
if (event.sensor.getType() == Sensor.TYPE_PROXIMITY) {
if (event.values[0] <
proximitySensor.getMaximumRange()){
startSpeechRecognition();
}
}
}
Force Sensors
 Three approaches
 Accelerometer-based
 Touch-width based – on some Android devices such as Nexus One
 External direct force-sending
 Example Direct Force-Sending
 Motorola Force Sensing Technology: http://www.motorola.com/Business/US-
EN/Technology_Licensing/Proprietary+Technology+Licensing/Force-
Sensing+Touch+Technology
 Works with resistive or capacitive screens
SensorDrone
SensorDrone Sensors
 Precision Electrochemical Gas Sensor – Calibrated for Carbon Monoxide (Also
can be used for precision measurements of Alcohol, Hydrogen, and others)
 Gas Sensor for Oxidizing Gases – MOS type for Chlorine, Ozone, Nitrogen
Dioxide, etc.
 Gas Sensor for Reducing Gases – (MOS type for methane, Propane, alcohols,
other
hydrocarbons, etc.)
 Temperature – Simple resistance temperature sensor type
 Humidity
 Pressure – can be used for Barometer, Altimeter, Blood Pressure, etc.
 Non-Contact Thermometer – Infrared sensor for scanning object temperature
 Proximity Capacitance – fluid level, intrusion detection, stud finder & more
applications
 Red Color Intensity
 Green Color Intensity
 Blue Color Intensity
 Illumination – combine RGB & illumination for color matching
 Digital & Analog Interface - Expansion connector for connecting anything you want
to your mobile device through the Sensordrone
Others?
 Radiation (dosimeter)
 Air quality
 Alcohol
 Glucose
 Breath analysis
 Fingerprint
 Motorola Atrix
 iPhone 5s: http://www.3g.co.uk/PR/March2013/Apple%20iPhone%205S%20-
%20To%20sport%20a%20fingerprint%20sensor.html
Healthcare
 One-lead ECG
 Body temperature
 Blood glucose
 Heart rate
 Blood oxygen saturation
 Body fat percentage
 Stress levels
Why Should App Developers Care?
Modern smartphone apps are different from web apps
 They use geolocation, camera, PIM contacts in interesting ways
Broad array of new smartphones senses opens up new classes of apps:
 Augmented reality – information about the world around you
 Pollution
 Altitude
 Barometric pressure
 More responsive intuitive games and user interfaces
 Pressure sensitivity: another intuitive input dimension
 Location-based apps – indoor and outdoor
 Promotions based on location
 Context-awareness in all apps
 Enhanced navigation/logistics/delivery
 Based on altitude, acceleration, directio
 Better self-driven healthcare
Why Do I Care?
 RhoMobile mission was always easy framework for enterprise apps
 My mission at Motorola is all developer facing APIs (Rho, Android Java, C#
for Windows Embedded Handheld)
 The sensor event handling model can be awkward with Android Java
 Its not crossplatform there
 There is overlap between those APIs and external devices
Sensor Handling in Android
public class SensorActivity extends Activity implements SensorEventListener {
private SensorManager mSensorManager;
private Sensor mPressure;
@Override public final void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
// Get an instance of the sensor service, and use that to get an instance of/ a particular sensor.
mSensorManager = (SensorManager) getSystemService(Context.SENSOR_SERVICE);
mPressure = mSensorManager.getDefaultSensor(Sensor.TYPE_PRESSURE);
}
@Override public final void onAccuracyChanged(Sensor sensor, int accuracy) {
// Do something here if sensor accuracy changes.
}
@Override public final void onSensorChanged(SensorEvent event) {
float millibars_of_pressure = event.values[0];
// Do something with this sensor data.
}
@Override protected void onResume() {
// Register a listener for the sensor.
super.onResume();
mSensorManager.registerListener(this, mPressure, SensorManager.SENSOR_DELAY_NORMAL);
}
@Override protected void onPause() {
// Be sure to unregister the sensor when the activity pauses.
super.onPause();
mSensorManager.unregisterListener(this);
}
}
Observer Patterns Make Event Handling Simple
require “observer”
class Notifier
end
class PressureNotifier < Notifier
def update(pressureValues)
if pressureValues.altitude.meters>3000
p “Watch out for hypoxia”
end
end
end
JavaScript for Sensor Data in RhoElements
(http://docs.rhomobile.com/rhoelements/RawSensors)
<META HTTP-EQUIV="RawSensors" CONTENT="sensorEvent:url('Javascript:onSensor(%json);');all:enabled; ”>
<SCRIPT>
function onSensor(jsonObject)
{
var theOutput = "<BR><BR><B>Accelerometer </B>";
theOutput = theOutput + "X: " + jsonObject.accelerometerX + ", Y: " + jsonObject.accelerometerY + ", Z: " + jsonObject.accelerometerZ + "<BR>";
theOutput = theOutput + "<B>Orientation </B>";
theOutput = theOutput + "X: " + jsonObject.deviceOrientation + "<BR>";
theOutput = theOutput + "<B>Tilt </B>";
theOutput = theOutput + "X: " + jsonObject.tiltangleX + ", Y: " + jsonObject.tiltangleY + ", Z: " + jsonObject.tiltangleZ + "<BR>";
theOutput = theOutput + "<B>Motion </B>";
theOutput = theOutput + "X: " + jsonObject.motion + "<BR>";
theOutput = theOutput + "<B>Ecompass </B>";
theOutput = theOutput + "X: " + jsonObject.ecompass + "<BR>";
theOutput = theOutput + "<B>Magnetometer </B>";
theOutput = theOutput + "X: " + jsonObject.magnetometerX + ", Y: " + jsonObject.magnetometerY + ", Z: " + jsonObject.magnetometerZ + "<BR>";
theOutput = theOutput + "<B>Gyroscope </B>";
theOutput = theOutput + "X: " + jsonObject.gyroscopeX + ", Y: " + jsonObject.gyroscopeY + ", Z: " + jsonObject.gyroscopeZ + "<BR>";
theOutput = theOutput + "<B>AmbientLight </B>";
theOutput = theOutput + "X: " + jsonObject.ambientLight + "<BR>";
theOutput = theOutput + "<B>Proximity </B>";
theOutput = theOutput + "X: " + jsonObject.proximity + "<BR>";
theOutput = theOutput + "<B>Proximitylongrange </B>";
theOutput = theOutput + "X: " + jsonObject.proximitylongrange + "<BR>";
theOutput = theOutput + "<B>Pressure </B>";
theOutput = theOutput + "X: " + jsonObject.pressure + "<BR>";
theOutput = theOutput + "<B>Temperature </B>";
theOutput = theOutput + "X: " + jsonObject.temperature + "<BR>";
theOutput = theOutput + "<B>Humidity </B>";
theOutput = theOutput + "X: " + jsonObject.humidity + "<BR>";
theOutput = theOutput + "<B>Gravity </B>";
theOutput = theOutput + "X: " + jsonObject.gravityX + ", Y: " + jsonObject.gravityY + ", Z: " + jsonObject.gravityZ + "<BR>";
theOutput = theOutput + "<B>Linear Acceleration </B>";
theOutput = theOutput + "X: " + jsonObject.linearAccelerationX + ", Y: " + jsonObject.linearAccelerationY + ", Z: " + jsonObject.linearAccelerationZ + "<BR>";
theOutput = theOutput + "<B>Rotation </B>";
theOutput = theOutput + "X: " + jsonObject.rotationX + ", Y: " + jsonObject.rotationY + ", Z: " + jsonObject.rotationZ + "<BR>";
theOutput = theOutput + "<B>Orientation </B>";
theOutput = theOutput + "X: " + jsonObject.orientationX + ", Y: " + jsonObject.orientationY + ", Z: " + jsonObject.orientationZ + "<BR>";
outputDiv.innerHTML = theOutput;
}
</SCRIPT>
<div id="outputDiv">Sensor Output Goes Here</div>
<P>
<INPUT align="center" type="button" value="Retrieve Sensor Data" onclick="RawSensors.getSensorData();"><br>
The Sensory Smartphone
• Definition of modern smartphone app continues to change
•Continues to be about richer device capabilities and
computing at the edge
• Accelerates the different between “native apps” and web
standards
• New categories of apps are possible
• Frameworks and tools can add accelerate these trends
Watch the video with slide synchronization on
InfoQ.com!
http://www.infoq.com/presentations/mobile-
smartphone-sensors

Contenu connexe

En vedette

Дмитрий Рыжков. Intel Android x86.
Дмитрий Рыжков. Intel Android x86.Дмитрий Рыжков. Intel Android x86.
Дмитрий Рыжков. Intel Android x86.Leonid Bogolubov
 
писаревский алексей
писаревский алексейписаревский алексей
писаревский алексейapps4allru
 
Живые обои для Android. Как создать. Тонкости. Продвижение
Живые обои для Android. Как создать. Тонкости. ПродвижениеЖивые обои для Android. Как создать. Тонкости. Продвижение
Живые обои для Android. Как создать. Тонкости. ПродвижениеSergey Mikhaylov
 
Use-Case is Everything
Use-Case is EverythingUse-Case is Everything
Use-Case is EverythingChinmay V S
 
Android - 14 - Geodata
Android - 14 - GeodataAndroid - 14 - Geodata
Android - 14 - GeodataNoveo
 
CPAлим темы
CPAлим темыCPAлим темы
CPAлим темыAppTractor
 
Презентация - SAMSUNG GT N5100 GALAXY NOTE 8.0 (uaseller.org)
Презентация - SAMSUNG GT N5100 GALAXY NOTE 8.0 (uaseller.org)Презентация - SAMSUNG GT N5100 GALAXY NOTE 8.0 (uaseller.org)
Презентация - SAMSUNG GT N5100 GALAXY NOTE 8.0 (uaseller.org)uaseller.org
 
Android Sensor and Framework - AWARE
Android Sensor and  Framework - AWAREAndroid Sensor and  Framework - AWARE
Android Sensor and Framework - AWAREDarrenJin
 

En vedette (13)

Дмитрий Рыжков. Intel Android x86.
Дмитрий Рыжков. Intel Android x86.Дмитрий Рыжков. Intel Android x86.
Дмитрий Рыжков. Intel Android x86.
 
писаревский алексей
писаревский алексейписаревский алексей
писаревский алексей
 
Brew Compilation
Brew CompilationBrew Compilation
Brew Compilation
 
Живые обои для Android. Как создать. Тонкости. Продвижение
Живые обои для Android. Как создать. Тонкости. ПродвижениеЖивые обои для Android. Как создать. Тонкости. Продвижение
Живые обои для Android. Как создать. Тонкости. Продвижение
 
Use-Case is Everything
Use-Case is EverythingUse-Case is Everything
Use-Case is Everything
 
Android Location Api
Android Location ApiAndroid Location Api
Android Location Api
 
Play Store
Play StorePlay Store
Play Store
 
Android - 14 - Geodata
Android - 14 - GeodataAndroid - 14 - Geodata
Android - 14 - Geodata
 
CPAлим темы
CPAлим темыCPAлим темы
CPAлим темы
 
Sensor android
Sensor androidSensor android
Sensor android
 
Презентация - SAMSUNG GT N5100 GALAXY NOTE 8.0 (uaseller.org)
Презентация - SAMSUNG GT N5100 GALAXY NOTE 8.0 (uaseller.org)Презентация - SAMSUNG GT N5100 GALAXY NOTE 8.0 (uaseller.org)
Презентация - SAMSUNG GT N5100 GALAXY NOTE 8.0 (uaseller.org)
 
Android Preferences
Android PreferencesAndroid Preferences
Android Preferences
 
Android Sensor and Framework - AWARE
Android Sensor and  Framework - AWAREAndroid Sensor and  Framework - AWARE
Android Sensor and Framework - AWARE
 

Plus de C4Media

Streaming a Million Likes/Second: Real-Time Interactions on Live Video
Streaming a Million Likes/Second: Real-Time Interactions on Live VideoStreaming a Million Likes/Second: Real-Time Interactions on Live Video
Streaming a Million Likes/Second: Real-Time Interactions on Live VideoC4Media
 
Next Generation Client APIs in Envoy Mobile
Next Generation Client APIs in Envoy MobileNext Generation Client APIs in Envoy Mobile
Next Generation Client APIs in Envoy MobileC4Media
 
Software Teams and Teamwork Trends Report Q1 2020
Software Teams and Teamwork Trends Report Q1 2020Software Teams and Teamwork Trends Report Q1 2020
Software Teams and Teamwork Trends Report Q1 2020C4Media
 
Understand the Trade-offs Using Compilers for Java Applications
Understand the Trade-offs Using Compilers for Java ApplicationsUnderstand the Trade-offs Using Compilers for Java Applications
Understand the Trade-offs Using Compilers for Java ApplicationsC4Media
 
Kafka Needs No Keeper
Kafka Needs No KeeperKafka Needs No Keeper
Kafka Needs No KeeperC4Media
 
High Performing Teams Act Like Owners
High Performing Teams Act Like OwnersHigh Performing Teams Act Like Owners
High Performing Teams Act Like OwnersC4Media
 
Does Java Need Inline Types? What Project Valhalla Can Bring to Java
Does Java Need Inline Types? What Project Valhalla Can Bring to JavaDoes Java Need Inline Types? What Project Valhalla Can Bring to Java
Does Java Need Inline Types? What Project Valhalla Can Bring to JavaC4Media
 
Service Meshes- The Ultimate Guide
Service Meshes- The Ultimate GuideService Meshes- The Ultimate Guide
Service Meshes- The Ultimate GuideC4Media
 
Shifting Left with Cloud Native CI/CD
Shifting Left with Cloud Native CI/CDShifting Left with Cloud Native CI/CD
Shifting Left with Cloud Native CI/CDC4Media
 
CI/CD for Machine Learning
CI/CD for Machine LearningCI/CD for Machine Learning
CI/CD for Machine LearningC4Media
 
Fault Tolerance at Speed
Fault Tolerance at SpeedFault Tolerance at Speed
Fault Tolerance at SpeedC4Media
 
Architectures That Scale Deep - Regaining Control in Deep Systems
Architectures That Scale Deep - Regaining Control in Deep SystemsArchitectures That Scale Deep - Regaining Control in Deep Systems
Architectures That Scale Deep - Regaining Control in Deep SystemsC4Media
 
ML in the Browser: Interactive Experiences with Tensorflow.js
ML in the Browser: Interactive Experiences with Tensorflow.jsML in the Browser: Interactive Experiences with Tensorflow.js
ML in the Browser: Interactive Experiences with Tensorflow.jsC4Media
 
Build Your Own WebAssembly Compiler
Build Your Own WebAssembly CompilerBuild Your Own WebAssembly Compiler
Build Your Own WebAssembly CompilerC4Media
 
User & Device Identity for Microservices @ Netflix Scale
User & Device Identity for Microservices @ Netflix ScaleUser & Device Identity for Microservices @ Netflix Scale
User & Device Identity for Microservices @ Netflix ScaleC4Media
 
Scaling Patterns for Netflix's Edge
Scaling Patterns for Netflix's EdgeScaling Patterns for Netflix's Edge
Scaling Patterns for Netflix's EdgeC4Media
 
Make Your Electron App Feel at Home Everywhere
Make Your Electron App Feel at Home EverywhereMake Your Electron App Feel at Home Everywhere
Make Your Electron App Feel at Home EverywhereC4Media
 
The Talk You've Been Await-ing For
The Talk You've Been Await-ing ForThe Talk You've Been Await-ing For
The Talk You've Been Await-ing ForC4Media
 
Future of Data Engineering
Future of Data EngineeringFuture of Data Engineering
Future of Data EngineeringC4Media
 
Automated Testing for Terraform, Docker, Packer, Kubernetes, and More
Automated Testing for Terraform, Docker, Packer, Kubernetes, and MoreAutomated Testing for Terraform, Docker, Packer, Kubernetes, and More
Automated Testing for Terraform, Docker, Packer, Kubernetes, and MoreC4Media
 

Plus de C4Media (20)

Streaming a Million Likes/Second: Real-Time Interactions on Live Video
Streaming a Million Likes/Second: Real-Time Interactions on Live VideoStreaming a Million Likes/Second: Real-Time Interactions on Live Video
Streaming a Million Likes/Second: Real-Time Interactions on Live Video
 
Next Generation Client APIs in Envoy Mobile
Next Generation Client APIs in Envoy MobileNext Generation Client APIs in Envoy Mobile
Next Generation Client APIs in Envoy Mobile
 
Software Teams and Teamwork Trends Report Q1 2020
Software Teams and Teamwork Trends Report Q1 2020Software Teams and Teamwork Trends Report Q1 2020
Software Teams and Teamwork Trends Report Q1 2020
 
Understand the Trade-offs Using Compilers for Java Applications
Understand the Trade-offs Using Compilers for Java ApplicationsUnderstand the Trade-offs Using Compilers for Java Applications
Understand the Trade-offs Using Compilers for Java Applications
 
Kafka Needs No Keeper
Kafka Needs No KeeperKafka Needs No Keeper
Kafka Needs No Keeper
 
High Performing Teams Act Like Owners
High Performing Teams Act Like OwnersHigh Performing Teams Act Like Owners
High Performing Teams Act Like Owners
 
Does Java Need Inline Types? What Project Valhalla Can Bring to Java
Does Java Need Inline Types? What Project Valhalla Can Bring to JavaDoes Java Need Inline Types? What Project Valhalla Can Bring to Java
Does Java Need Inline Types? What Project Valhalla Can Bring to Java
 
Service Meshes- The Ultimate Guide
Service Meshes- The Ultimate GuideService Meshes- The Ultimate Guide
Service Meshes- The Ultimate Guide
 
Shifting Left with Cloud Native CI/CD
Shifting Left with Cloud Native CI/CDShifting Left with Cloud Native CI/CD
Shifting Left with Cloud Native CI/CD
 
CI/CD for Machine Learning
CI/CD for Machine LearningCI/CD for Machine Learning
CI/CD for Machine Learning
 
Fault Tolerance at Speed
Fault Tolerance at SpeedFault Tolerance at Speed
Fault Tolerance at Speed
 
Architectures That Scale Deep - Regaining Control in Deep Systems
Architectures That Scale Deep - Regaining Control in Deep SystemsArchitectures That Scale Deep - Regaining Control in Deep Systems
Architectures That Scale Deep - Regaining Control in Deep Systems
 
ML in the Browser: Interactive Experiences with Tensorflow.js
ML in the Browser: Interactive Experiences with Tensorflow.jsML in the Browser: Interactive Experiences with Tensorflow.js
ML in the Browser: Interactive Experiences with Tensorflow.js
 
Build Your Own WebAssembly Compiler
Build Your Own WebAssembly CompilerBuild Your Own WebAssembly Compiler
Build Your Own WebAssembly Compiler
 
User & Device Identity for Microservices @ Netflix Scale
User & Device Identity for Microservices @ Netflix ScaleUser & Device Identity for Microservices @ Netflix Scale
User & Device Identity for Microservices @ Netflix Scale
 
Scaling Patterns for Netflix's Edge
Scaling Patterns for Netflix's EdgeScaling Patterns for Netflix's Edge
Scaling Patterns for Netflix's Edge
 
Make Your Electron App Feel at Home Everywhere
Make Your Electron App Feel at Home EverywhereMake Your Electron App Feel at Home Everywhere
Make Your Electron App Feel at Home Everywhere
 
The Talk You've Been Await-ing For
The Talk You've Been Await-ing ForThe Talk You've Been Await-ing For
The Talk You've Been Await-ing For
 
Future of Data Engineering
Future of Data EngineeringFuture of Data Engineering
Future of Data Engineering
 
Automated Testing for Terraform, Docker, Packer, Kubernetes, and More
Automated Testing for Terraform, Docker, Packer, Kubernetes, and MoreAutomated Testing for Terraform, Docker, Packer, Kubernetes, and More
Automated Testing for Terraform, Docker, Packer, Kubernetes, and More
 

Dernier

Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersRaghuram Pandurangan
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rick Flair
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterMydbops
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demoHarshalMandlekar2
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 

Dernier (20)

Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL Router
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demo
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 

Advanced Sensors in Mobile Devices

  • 1. Sensing Mobile Devices and what it means for app developers
  • 2. InfoQ.com: News & Community Site • 750,000 unique visitors/month • Published in 4 languages (English, Chinese, Japanese and Brazilian Portuguese) • Post content from our QCon conferences • News 15-20 / week • Articles 3-4 / week • Presentations (videos) 12-15 / week • Interviews 2-3 / week • Books 1 / month Watch the video with slide synchronization on InfoQ.com! http://www.infoq.com/presentations /mobile-smartphone-sensors
  • 3. Presented at QCon London www.qconlondon.com Purpose of QCon - to empower software development by facilitating the spread of knowledge and innovation Strategy - practitioner-driven conference designed for YOU: influencers of change and innovation in your teams - speakers and topics driving the evolution and innovation - connecting and catalyzing the influencers and innovators Highlights - attended by more than 12,000 delegates since 2007 - held in 9 cities worldwide
  • 4. Why the “Sensory Smartphone”?  Smartphones are becoming more and more powerful  And near ubiquitous  They are adding all the capabilities that we have as sensing human  And augmenting them in ways that humans don’t have
  • 5. Developments in Sensory Smartphones  Accelerometer/Gyroscope  Magnetometer  Locationing  Ambient light  Ambient temperature  Air pressure  Proximity  Humidity  Force Sensitivity
  • 6. Accelerometer/Gyroscope  Accelerometer  acceleration as three values (x,y,z axes) in m/s2  almost every smartphone has one now  Gyroscope  acceleration as three values (x,y,z axes) in radians/s2  can be done with accelerometer and magnetometer but not as smooth  iPhones and most highend Android devices have gyroscopes
  • 7. Accelerometer/Magnetometer for Real World Coordinates if(SensorManager.getRotationMatrix(R, null, AccelerometerValues_last, MagneticFieldValues_last)) { SensorManager.remapCoordinateSystem(R, SensorManager.AXIS_Y, SensorManager.AXIS_MINUS_X, remapR); SensorManager.getOrientation(remapR, orientationValues); Matrix.multiplyMV(orientationVector, 0, remapR, 0, sZVector, 0); pitch = (float) (-Math.atan2(orientationVector[1], orientationVector[2]) * RADIANS_TO_DEGREES); orientation = (float) (-Math.atan2(orientationVector[0], orientationVector[1]) * RADIANS_TO_DEGREES); Matrix.invertM(remapR_inv, 0, remapR, 0); Matrix.multiplyMV(azimuthVector, 0, remapR_inv, 0, sZVector, 0); azimuth = (float) (180 + Math.atan2(azimuthVector[0], azimuthVector[1]) * RADIANS_TO_DEGREES); }
  • 8. Hierarchy of Location Capabilities  GPS  Precision of 20-50m  3 satellites for 2D fix, 4 satellites for 3D fix  Doesn’t work indoors, drains battery  Cell tower triangulation  Wifi network triangulation  Indoor locationing  RFID  Extended Large Tag NFC
  • 9. Indoor Locationing Techniques  Wifi/WLAN  WLAN “fingerprinting” makes it more accurate (database of Wifi signature data)  Often in combination with indoor maps  Bluetooth  Range: 10-30m, precision 5-10m (many access points required)  Bluetooth 4 on most devices (must be set to visible)  RFID  Up to 200m range  UWB  High precision (<0.3m), high data rates, low energy  Not in smartphones yet , high cost  Zigbee  Same underlying technology as UWB, not available directly on smartphones today  Ultrasound  High precision (~1cm), lots of sensors, vulnerable to interference  IR  Requires line of sight, very high precision (~1mm), superceded by other technologies
  • 10.
  • 11. Ambient Light Sensors  Implemented as multiple photodiodes  Saves smartphone power by optimizing brightness  Reduces eyestrain  Not really used in apps today  Except indirectly
  • 12. Ambient Light Sensor Code public class AndroidLightSensorActivity extends Activity { public void onCreate(Bundle savedInstanceState) { SensorManager sensorManager = (SensorManager)getSystemService(Context.SENSOR_SERVICE); Sensor lightSensor = sensorManager.getDefaultSensor(Sensor.TYPE_LIGHT); if (lightSensor == null){ Toast.makeText(AndroidLightSensorActivity.this, "No Light Sensor! quit-", Toast.LENGTH_LONG).show(); }else{ float max = lightSensor.getMaximumRange(); lightMeter.setMax((int)max); textMax.setText("Max Reading: " + String.valueOf(max)); sensorManager.registerListener(lightSensorEventListener, lightSensor, SensorManager.SENSOR_DELAY_NORMAL); } } SensorEventListener lightSensorEventListener = new SensorEventListener(){ public void onSensorChanged(SensorEvent event) { if(event.sensor.getType()==Sensor.TYPE_LIGHT){ float currentReading = event.values[0]; lightMeter.setProgress((int)currentReading); textReading.setText("Current Reading: " + String.valueOf(currentReading)); } } };
  • 13. Ambient Temperature  Temperature measures battery temperature and is available on most devices  But its deprecated as of Android 4.0  Ambient Temperature measures ambient air temperature  new in Android 4.0 (Ice Cream Sandwich)  Few devices today  Arrows Z ISW13F  But Sensirion has ambient temperature/humidity chip
  • 14. Relative Humidity  Combined with ambient temperature get dew point: ln(RH/100%) + m·t/(Tn+t) td(t,RH) = Tn · ------------------------------------ m - [ln(RH/100%) + m·t/(Tn+t)]  Absolute humidity (RH/100%) · A · exp(m·t/(Tn+t) dv(t,RH) = 216.7 · ------------------------------------ 273.15 + t
  • 15. Ambient Air Pressure  Barometer showing up on more and more devices  Xperia Active. Xperia Go. Galaxy S3. Galaxy Nexus. Galaxy Note. Galaxy Note2. Motorola Xoom  Provides altitude information WITHOUT GPS  Accelerates GPS calculations as it provides first cut guess at altitude before satellite fix  Predicting impending storms when out in the field  See Barometer and Altimeter apps on Google Play
  • 16. Proximity  On Android, returns number of centimeters distant  Not exposed on iPhone formally (but some apps use it anyway)  Most often implemented on Android as light sensor  Specifically ISL29003/23 or GP2A chip  Note that most sensors return only “near” or “far” (high or low) values public void onSensorChanged(SensorEvent event) { if (event.sensor.getType() == Sensor.TYPE_PROXIMITY) { if (event.values[0] < proximitySensor.getMaximumRange()){ startSpeechRecognition(); } } }
  • 17. Force Sensors  Three approaches  Accelerometer-based  Touch-width based – on some Android devices such as Nexus One  External direct force-sending  Example Direct Force-Sending  Motorola Force Sensing Technology: http://www.motorola.com/Business/US- EN/Technology_Licensing/Proprietary+Technology+Licensing/Force- Sensing+Touch+Technology  Works with resistive or capacitive screens
  • 19. SensorDrone Sensors  Precision Electrochemical Gas Sensor – Calibrated for Carbon Monoxide (Also can be used for precision measurements of Alcohol, Hydrogen, and others)  Gas Sensor for Oxidizing Gases – MOS type for Chlorine, Ozone, Nitrogen Dioxide, etc.  Gas Sensor for Reducing Gases – (MOS type for methane, Propane, alcohols, other hydrocarbons, etc.)  Temperature – Simple resistance temperature sensor type  Humidity  Pressure – can be used for Barometer, Altimeter, Blood Pressure, etc.  Non-Contact Thermometer – Infrared sensor for scanning object temperature  Proximity Capacitance – fluid level, intrusion detection, stud finder & more applications  Red Color Intensity  Green Color Intensity  Blue Color Intensity  Illumination – combine RGB & illumination for color matching  Digital & Analog Interface - Expansion connector for connecting anything you want to your mobile device through the Sensordrone
  • 20. Others?  Radiation (dosimeter)  Air quality  Alcohol  Glucose  Breath analysis  Fingerprint  Motorola Atrix  iPhone 5s: http://www.3g.co.uk/PR/March2013/Apple%20iPhone%205S%20- %20To%20sport%20a%20fingerprint%20sensor.html
  • 21. Healthcare  One-lead ECG  Body temperature  Blood glucose  Heart rate  Blood oxygen saturation  Body fat percentage  Stress levels
  • 22. Why Should App Developers Care? Modern smartphone apps are different from web apps  They use geolocation, camera, PIM contacts in interesting ways Broad array of new smartphones senses opens up new classes of apps:  Augmented reality – information about the world around you  Pollution  Altitude  Barometric pressure  More responsive intuitive games and user interfaces  Pressure sensitivity: another intuitive input dimension  Location-based apps – indoor and outdoor  Promotions based on location  Context-awareness in all apps  Enhanced navigation/logistics/delivery  Based on altitude, acceleration, directio  Better self-driven healthcare
  • 23. Why Do I Care?  RhoMobile mission was always easy framework for enterprise apps  My mission at Motorola is all developer facing APIs (Rho, Android Java, C# for Windows Embedded Handheld)  The sensor event handling model can be awkward with Android Java  Its not crossplatform there  There is overlap between those APIs and external devices
  • 24. Sensor Handling in Android public class SensorActivity extends Activity implements SensorEventListener { private SensorManager mSensorManager; private Sensor mPressure; @Override public final void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); // Get an instance of the sensor service, and use that to get an instance of/ a particular sensor. mSensorManager = (SensorManager) getSystemService(Context.SENSOR_SERVICE); mPressure = mSensorManager.getDefaultSensor(Sensor.TYPE_PRESSURE); } @Override public final void onAccuracyChanged(Sensor sensor, int accuracy) { // Do something here if sensor accuracy changes. } @Override public final void onSensorChanged(SensorEvent event) { float millibars_of_pressure = event.values[0]; // Do something with this sensor data. } @Override protected void onResume() { // Register a listener for the sensor. super.onResume(); mSensorManager.registerListener(this, mPressure, SensorManager.SENSOR_DELAY_NORMAL); } @Override protected void onPause() { // Be sure to unregister the sensor when the activity pauses. super.onPause(); mSensorManager.unregisterListener(this); } }
  • 25. Observer Patterns Make Event Handling Simple require “observer” class Notifier end class PressureNotifier < Notifier def update(pressureValues) if pressureValues.altitude.meters>3000 p “Watch out for hypoxia” end end end
  • 26. JavaScript for Sensor Data in RhoElements (http://docs.rhomobile.com/rhoelements/RawSensors) <META HTTP-EQUIV="RawSensors" CONTENT="sensorEvent:url('Javascript:onSensor(%json);');all:enabled; ”> <SCRIPT> function onSensor(jsonObject) { var theOutput = "<BR><BR><B>Accelerometer </B>"; theOutput = theOutput + "X: " + jsonObject.accelerometerX + ", Y: " + jsonObject.accelerometerY + ", Z: " + jsonObject.accelerometerZ + "<BR>"; theOutput = theOutput + "<B>Orientation </B>"; theOutput = theOutput + "X: " + jsonObject.deviceOrientation + "<BR>"; theOutput = theOutput + "<B>Tilt </B>"; theOutput = theOutput + "X: " + jsonObject.tiltangleX + ", Y: " + jsonObject.tiltangleY + ", Z: " + jsonObject.tiltangleZ + "<BR>"; theOutput = theOutput + "<B>Motion </B>"; theOutput = theOutput + "X: " + jsonObject.motion + "<BR>"; theOutput = theOutput + "<B>Ecompass </B>"; theOutput = theOutput + "X: " + jsonObject.ecompass + "<BR>"; theOutput = theOutput + "<B>Magnetometer </B>"; theOutput = theOutput + "X: " + jsonObject.magnetometerX + ", Y: " + jsonObject.magnetometerY + ", Z: " + jsonObject.magnetometerZ + "<BR>"; theOutput = theOutput + "<B>Gyroscope </B>"; theOutput = theOutput + "X: " + jsonObject.gyroscopeX + ", Y: " + jsonObject.gyroscopeY + ", Z: " + jsonObject.gyroscopeZ + "<BR>"; theOutput = theOutput + "<B>AmbientLight </B>"; theOutput = theOutput + "X: " + jsonObject.ambientLight + "<BR>"; theOutput = theOutput + "<B>Proximity </B>"; theOutput = theOutput + "X: " + jsonObject.proximity + "<BR>"; theOutput = theOutput + "<B>Proximitylongrange </B>"; theOutput = theOutput + "X: " + jsonObject.proximitylongrange + "<BR>"; theOutput = theOutput + "<B>Pressure </B>"; theOutput = theOutput + "X: " + jsonObject.pressure + "<BR>"; theOutput = theOutput + "<B>Temperature </B>"; theOutput = theOutput + "X: " + jsonObject.temperature + "<BR>"; theOutput = theOutput + "<B>Humidity </B>"; theOutput = theOutput + "X: " + jsonObject.humidity + "<BR>"; theOutput = theOutput + "<B>Gravity </B>"; theOutput = theOutput + "X: " + jsonObject.gravityX + ", Y: " + jsonObject.gravityY + ", Z: " + jsonObject.gravityZ + "<BR>"; theOutput = theOutput + "<B>Linear Acceleration </B>"; theOutput = theOutput + "X: " + jsonObject.linearAccelerationX + ", Y: " + jsonObject.linearAccelerationY + ", Z: " + jsonObject.linearAccelerationZ + "<BR>"; theOutput = theOutput + "<B>Rotation </B>"; theOutput = theOutput + "X: " + jsonObject.rotationX + ", Y: " + jsonObject.rotationY + ", Z: " + jsonObject.rotationZ + "<BR>"; theOutput = theOutput + "<B>Orientation </B>"; theOutput = theOutput + "X: " + jsonObject.orientationX + ", Y: " + jsonObject.orientationY + ", Z: " + jsonObject.orientationZ + "<BR>"; outputDiv.innerHTML = theOutput; } </SCRIPT> <div id="outputDiv">Sensor Output Goes Here</div> <P> <INPUT align="center" type="button" value="Retrieve Sensor Data" onclick="RawSensors.getSensorData();"><br>
  • 27. The Sensory Smartphone • Definition of modern smartphone app continues to change •Continues to be about richer device capabilities and computing at the edge • Accelerates the different between “native apps” and web standards • New categories of apps are possible • Frameworks and tools can add accelerate these trends
  • 28. Watch the video with slide synchronization on InfoQ.com! http://www.infoq.com/presentations/mobile- smartphone-sensors