SlideShare a Scribd company logo
1 of 68
Watch the video with slide 
synchronization on InfoQ.com! 
http://www.infoq.com/presentations 
/sensors-tracking-user-activity 
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
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
Sensors aren’t enough 
Mo Ramezanpoor 
Six to Start 
@mohsenr
Agenda 
A look at fitness tracking apps! 
• Tailored data processing 
• Adapting the UI 
Overcoming device limitations! 
• Reducing battery use 
• Keeping the app alive 
Handling sensor data! 
• Keeping track of time 
• Distance calculation
Zombies, Run!
The Walk
Reducing battery use
Reducing battery use 
Don’t use CPU if you can! 
• Get data points in batches 
• Don’t use standalone timers to update the UI 
• Defer data processing as much as possible 
Only ask for the accurate that you need! 
• Accurate location data will require multiple antennae 
• Accurate motion data will require multiple sensors 
• Accurate data points are computationally more expensive to produce
Keeping the app alive (iOS)
Keeping the app alive (iOS) 
Play audio in the background! 
• If you already need to play audio in the background 
• If you need to completely stop the device from sleeping 
Track location! 
• Using significant location change updates 
• Using explicit location tracking but with low accuracy 
Use notifications! 
• If your app’s behaviour depend on external sources 
• f you have can assume network connectivity
Keeping track of time
“Absolute” time 
26 35 44…ticks since first tick!
“Absolute” time 
26 35 44…ticks since first tick! 
“System” time 
182 186 190…seconds since reference
“Absolute” time 
26 35 44…ticks since first tick! 
“System” time 
182 186 190…seconds since reference 
“Calendar” time 
13:30:08 13:30:12 13:30:16…on March 7, 2014
Calendar time jumps 
“System” time 
“Calendar” time 
…seconds since reference 
…on March 30, 2014
Calendar time jumps 
“System” time 
312 
“Calendar” time 
10:59:58 
GMT 
…seconds since reference 
…on March 30, 2014
Calendar time jumps 
“System” time 
312 
“Calendar” time 
10:59:58 
GMT 
313 
10:59:59 
GMT 
…seconds since reference 
…on March 30, 2014
Calendar time jumps 
“System” time 
314 
312 
“Calendar” time 
10:59:58 
GMT 
313 
10:59:59 
GMT 
…seconds since reference 
…on March 30, 2014
Calendar time jumps 
“System” time 
314 
312 
“Calendar” time 
10:59:58 
GMT 
313 
10:59:59 
GMT 
…seconds since reference 
Timezone changes 
…on March 30, 2014
Calendar time jumps 
“System” time 
314 
312 
“Calendar” time 
10:59:58 
GMT 
313 
10:59:59 
GMT 
…seconds since reference 
Timezone changes 
03:00:00 
Pacific Time 
…on March 30, 2014
Calendar time jumps 
“System” time 
“Calendar” time 
…seconds since reference 
…on March 30, 2014
Calendar time jumps 
“System” time 
312 
“Calendar” time 
00:59:58 
GMT 
…seconds since reference 
…on March 30, 2014
Calendar time jumps 
“System” time 
312 
“Calendar” time 
00:59:58 
GMT 
313 
00:59:59 
GMT 
…seconds since reference 
…on March 30, 2014
Calendar time jumps 
“System” time 
314 
312 
“Calendar” time 
00:59:58 
GMT 
313 
00:59:59 
GMT 
…seconds since reference 
…on March 30, 2014
Calendar time jumps 
“System” time 
314 
312 
“Calendar” time 
00:59:58 
GMT 
313 
00:59:59 
GMT 
…seconds since reference 
Daylight saving starts 
…on March 30, 2014
Calendar time jumps 
“System” time 
314 
312 
“Calendar” time 
00:59:58 
GMT 
313 
00:59:59 
GMT 
…seconds since reference 
Daylight saving starts 
02:00:00 
BST 
…on March 30, 2014
Calendar time jumps 
Managing calendar date and time is hard! 
… but is not our problem! 
… as long as we don’t use them!
System time jumps 
“Absolute” time 
“System” time 
…ticks 
…seconds
System time jumps 
“Absolute” time 
26 …ticks 
“System” time 
312 
…seconds
System time jumps 
“Absolute” time 
26 
“System” time 
312 
35 …ticks 
313 
…seconds
System time jumps 
“Absolute” time 
26 
“System” time 
312 
35 44…ticks 
313 
…seconds
System time jumps 
“Absolute” time 
26 
“System” time 
35 44…ticks 
Network date update 
312 
313 
…seconds
System time jumps 
“Absolute” time 
35 44…ticks 
213 
26 
“System” time 
Network date update 
312 
313 
…seconds
Solution:! 
System time jumps 
1. Do nothing 
2. “Anchor” the time 
3. Tell the user
“Anchored” Time 
“Absolute” time 
26 35 44…ticks 
+295 +295 +195…offset 
“System” time 
Network date update 
312 313 213 
…seconds since reference
“Anchored” Time 
“Absolute” time 
26 35 44…ticks 
17 18 19…seconds since boot 
+295 +295 +195…offset 
“System” time 
Network date update 
312 313 213 
…seconds since reference
“Anchored” Time 
Prepare:! 
! 
double initialOffset = SystemTime() - AbsoluteTime(); 
! 
Start recording:! 
! 
// Wait for data! 
! 
New data received:! 
! 
double currentOffset = SystemTime() - AbsoluteTime(); 
double drift = currentOffset - initialOffset; 
double anchoredTimestamp = timestamp - drift;
“Anchored” Time 
On iOS:! 
• Use CACurrentMediaTime() as AbsoluteTime(). 
• Use [NSDate timeIntervalSinceReferenceDate] as SystemTime(). 
! 
On Android:! 
• Use SystemClock.elapsedRealtimeNanos() as AbsoluteTime(). 
• Use System.currentTimeMillis() as SystemTime(). 
• Also see Location.getElapsedRealtimeNanos().
Distance calculation
Distance calculation
Distance calculation
Distance calculation
Distance calculation
Distance calculation
Distance calculation
Distance calculation
Distance calculation
Distance calculation
Distance calculation
Distance calculation
Distance calculation
Distance calculation
Distance calculation
Distance calculation
Distance calculation
Distance calculation
Distance calculation
Distance calculation
Distance calculation
Distance calculation
Distance calculation 
Remove points that! 
1. have unacceptably low accuracy 
2. are too close to the points before or after them 
Don’t remove points that! 
1. the user has seen 
2. are “too far”, unless you really know what you’re doing
Distance calculation 
Location data point’s “accuracy”! 
is not a scientific error value.
Distance calculation 
The Earth is not flat!! 
Don’t do cartesian maths.
Thank you!
Watch the video with slide synchronization on 
InfoQ.com! 
http://www.infoq.com/presentations/sensors-tracking- 
user-activity

More Related Content

Similar to Sensors Aren't Enough

Class5_DataloggerProgrammingArduino.pptx
Class5_DataloggerProgrammingArduino.pptxClass5_DataloggerProgrammingArduino.pptx
Class5_DataloggerProgrammingArduino.pptxHebaEng
 
#PDR15 - Best Use Cases For Timeline
#PDR15 - Best Use Cases For Timeline#PDR15 - Best Use Cases For Timeline
#PDR15 - Best Use Cases For TimelinePebble Technology
 
Getting Started with Splunk Enterprise
Getting Started with Splunk EnterpriseGetting Started with Splunk Enterprise
Getting Started with Splunk EnterpriseSplunk
 
Getting Started with Splunk Enterprise
Getting Started with Splunk EnterpriseGetting Started with Splunk Enterprise
Getting Started with Splunk EnterpriseShannon Cuthbertson
 
Echostar Customer Presentation
Echostar Customer PresentationEchostar Customer Presentation
Echostar Customer PresentationSplunk
 
How Netskope Mastered DevOps with Sumo Logic
How Netskope Mastered DevOps with Sumo LogicHow Netskope Mastered DevOps with Sumo Logic
How Netskope Mastered DevOps with Sumo Logic Sumo Logic
 
Thesis_presentation_arda_tasci
Thesis_presentation_arda_tasciThesis_presentation_arda_tasci
Thesis_presentation_arda_tasciArda Taşcı
 
Zombie Time - JSR 310 for the Undead
Zombie Time - JSR 310 for the UndeadZombie Time - JSR 310 for the Undead
Zombie Time - JSR 310 for the UndeadStephen Chin
 
SplunkSummit 2015 - A Quick Guide to Search Optimization
SplunkSummit 2015 - A Quick Guide to Search OptimizationSplunkSummit 2015 - A Quick Guide to Search Optimization
SplunkSummit 2015 - A Quick Guide to Search OptimizationSplunk
 
Graduating To Go - A Jumpstart into the Go Programming Language
Graduating To Go - A Jumpstart into the Go Programming LanguageGraduating To Go - A Jumpstart into the Go Programming Language
Graduating To Go - A Jumpstart into the Go Programming LanguageKaylyn Gibilterra
 
Implementing Relative Time in Cognos BI: Using OLAP Modeling & Reporting Tools
Implementing Relative Time in Cognos BI: Using OLAP Modeling & Reporting ToolsImplementing Relative Time in Cognos BI: Using OLAP Modeling & Reporting Tools
Implementing Relative Time in Cognos BI: Using OLAP Modeling & Reporting ToolsSenturus
 
Azure stream analytics by Nico Jacobs
Azure stream analytics by Nico JacobsAzure stream analytics by Nico Jacobs
Azure stream analytics by Nico JacobsITProceed
 
Lesson 05 - Time in Distrributed System.pptx
Lesson 05 - Time in Distrributed System.pptxLesson 05 - Time in Distrributed System.pptx
Lesson 05 - Time in Distrributed System.pptxLagamaPasala
 
Have Your Cake and Eat It Too -- Further Dispelling the Myths of the Lambda A...
Have Your Cake and Eat It Too -- Further Dispelling the Myths of the Lambda A...Have Your Cake and Eat It Too -- Further Dispelling the Myths of the Lambda A...
Have Your Cake and Eat It Too -- Further Dispelling the Myths of the Lambda A...C4Media
 
Serverless computing henry been - logging instrumentation dashboards alerts
Serverless computing   henry been - logging instrumentation dashboards alertsServerless computing   henry been - logging instrumentation dashboards alerts
Serverless computing henry been - logging instrumentation dashboards alertsHenry Been
 
UpdateConf 2018: Monitoring real-life Azure applications: When to use what an...
UpdateConf 2018: Monitoring real-life Azure applications: When to use what an...UpdateConf 2018: Monitoring real-life Azure applications: When to use what an...
UpdateConf 2018: Monitoring real-life Azure applications: When to use what an...Karl Ots
 
Opencast Matterhorn Harvard 2014 - Manchester Lecture Capture
Opencast Matterhorn Harvard 2014 - Manchester Lecture CaptureOpencast Matterhorn Harvard 2014 - Manchester Lecture Capture
Opencast Matterhorn Harvard 2014 - Manchester Lecture CaptureStuart Phillipson
 
Opening / Closing Remarks
Opening / Closing RemarksOpening / Closing Remarks
Opening / Closing RemarksSPSNewYorkCity
 

Similar to Sensors Aren't Enough (20)

Class5_DataloggerProgrammingArduino.pptx
Class5_DataloggerProgrammingArduino.pptxClass5_DataloggerProgrammingArduino.pptx
Class5_DataloggerProgrammingArduino.pptx
 
#PDR15 - Best Use Cases For Timeline
#PDR15 - Best Use Cases For Timeline#PDR15 - Best Use Cases For Timeline
#PDR15 - Best Use Cases For Timeline
 
Getting Started with Splunk Enterprise
Getting Started with Splunk EnterpriseGetting Started with Splunk Enterprise
Getting Started with Splunk Enterprise
 
Getting Started with Splunk Enterprise
Getting Started with Splunk EnterpriseGetting Started with Splunk Enterprise
Getting Started with Splunk Enterprise
 
MajesTech_PPT
MajesTech_PPTMajesTech_PPT
MajesTech_PPT
 
Echostar Customer Presentation
Echostar Customer PresentationEchostar Customer Presentation
Echostar Customer Presentation
 
How Netskope Mastered DevOps with Sumo Logic
How Netskope Mastered DevOps with Sumo LogicHow Netskope Mastered DevOps with Sumo Logic
How Netskope Mastered DevOps with Sumo Logic
 
Thesis_presentation_arda_tasci
Thesis_presentation_arda_tasciThesis_presentation_arda_tasci
Thesis_presentation_arda_tasci
 
Zombie Time - JSR 310 for the Undead
Zombie Time - JSR 310 for the UndeadZombie Time - JSR 310 for the Undead
Zombie Time - JSR 310 for the Undead
 
Ds @ bol
Ds @ bolDs @ bol
Ds @ bol
 
SplunkSummit 2015 - A Quick Guide to Search Optimization
SplunkSummit 2015 - A Quick Guide to Search OptimizationSplunkSummit 2015 - A Quick Guide to Search Optimization
SplunkSummit 2015 - A Quick Guide to Search Optimization
 
Graduating To Go - A Jumpstart into the Go Programming Language
Graduating To Go - A Jumpstart into the Go Programming LanguageGraduating To Go - A Jumpstart into the Go Programming Language
Graduating To Go - A Jumpstart into the Go Programming Language
 
Implementing Relative Time in Cognos BI: Using OLAP Modeling & Reporting Tools
Implementing Relative Time in Cognos BI: Using OLAP Modeling & Reporting ToolsImplementing Relative Time in Cognos BI: Using OLAP Modeling & Reporting Tools
Implementing Relative Time in Cognos BI: Using OLAP Modeling & Reporting Tools
 
Azure stream analytics by Nico Jacobs
Azure stream analytics by Nico JacobsAzure stream analytics by Nico Jacobs
Azure stream analytics by Nico Jacobs
 
Lesson 05 - Time in Distrributed System.pptx
Lesson 05 - Time in Distrributed System.pptxLesson 05 - Time in Distrributed System.pptx
Lesson 05 - Time in Distrributed System.pptx
 
Have Your Cake and Eat It Too -- Further Dispelling the Myths of the Lambda A...
Have Your Cake and Eat It Too -- Further Dispelling the Myths of the Lambda A...Have Your Cake and Eat It Too -- Further Dispelling the Myths of the Lambda A...
Have Your Cake and Eat It Too -- Further Dispelling the Myths of the Lambda A...
 
Serverless computing henry been - logging instrumentation dashboards alerts
Serverless computing   henry been - logging instrumentation dashboards alertsServerless computing   henry been - logging instrumentation dashboards alerts
Serverless computing henry been - logging instrumentation dashboards alerts
 
UpdateConf 2018: Monitoring real-life Azure applications: When to use what an...
UpdateConf 2018: Monitoring real-life Azure applications: When to use what an...UpdateConf 2018: Monitoring real-life Azure applications: When to use what an...
UpdateConf 2018: Monitoring real-life Azure applications: When to use what an...
 
Opencast Matterhorn Harvard 2014 - Manchester Lecture Capture
Opencast Matterhorn Harvard 2014 - Manchester Lecture CaptureOpencast Matterhorn Harvard 2014 - Manchester Lecture Capture
Opencast Matterhorn Harvard 2014 - Manchester Lecture Capture
 
Opening / Closing Remarks
Opening / Closing RemarksOpening / Closing Remarks
Opening / Closing Remarks
 

More from 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
 

More from 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
 

Recently uploaded

Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxnull - The Open Security Community
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraDeakin University
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024BookNet Canada
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 

Recently uploaded (20)

Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning era
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 

Sensors Aren't Enough

  • 1.
  • 2. Watch the video with slide synchronization on InfoQ.com! http://www.infoq.com/presentations /sensors-tracking-user-activity 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
  • 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. Sensors aren’t enough Mo Ramezanpoor Six to Start @mohsenr
  • 5. Agenda A look at fitness tracking apps! • Tailored data processing • Adapting the UI Overcoming device limitations! • Reducing battery use • Keeping the app alive Handling sensor data! • Keeping track of time • Distance calculation
  • 6.
  • 10. Reducing battery use Don’t use CPU if you can! • Get data points in batches • Don’t use standalone timers to update the UI • Defer data processing as much as possible Only ask for the accurate that you need! • Accurate location data will require multiple antennae • Accurate motion data will require multiple sensors • Accurate data points are computationally more expensive to produce
  • 11. Keeping the app alive (iOS)
  • 12. Keeping the app alive (iOS) Play audio in the background! • If you already need to play audio in the background • If you need to completely stop the device from sleeping Track location! • Using significant location change updates • Using explicit location tracking but with low accuracy Use notifications! • If your app’s behaviour depend on external sources • f you have can assume network connectivity
  • 14. “Absolute” time 26 35 44…ticks since first tick!
  • 15. “Absolute” time 26 35 44…ticks since first tick! “System” time 182 186 190…seconds since reference
  • 16. “Absolute” time 26 35 44…ticks since first tick! “System” time 182 186 190…seconds since reference “Calendar” time 13:30:08 13:30:12 13:30:16…on March 7, 2014
  • 17. Calendar time jumps “System” time “Calendar” time …seconds since reference …on March 30, 2014
  • 18. Calendar time jumps “System” time 312 “Calendar” time 10:59:58 GMT …seconds since reference …on March 30, 2014
  • 19. Calendar time jumps “System” time 312 “Calendar” time 10:59:58 GMT 313 10:59:59 GMT …seconds since reference …on March 30, 2014
  • 20. Calendar time jumps “System” time 314 312 “Calendar” time 10:59:58 GMT 313 10:59:59 GMT …seconds since reference …on March 30, 2014
  • 21. Calendar time jumps “System” time 314 312 “Calendar” time 10:59:58 GMT 313 10:59:59 GMT …seconds since reference Timezone changes …on March 30, 2014
  • 22. Calendar time jumps “System” time 314 312 “Calendar” time 10:59:58 GMT 313 10:59:59 GMT …seconds since reference Timezone changes 03:00:00 Pacific Time …on March 30, 2014
  • 23. Calendar time jumps “System” time “Calendar” time …seconds since reference …on March 30, 2014
  • 24. Calendar time jumps “System” time 312 “Calendar” time 00:59:58 GMT …seconds since reference …on March 30, 2014
  • 25. Calendar time jumps “System” time 312 “Calendar” time 00:59:58 GMT 313 00:59:59 GMT …seconds since reference …on March 30, 2014
  • 26. Calendar time jumps “System” time 314 312 “Calendar” time 00:59:58 GMT 313 00:59:59 GMT …seconds since reference …on March 30, 2014
  • 27. Calendar time jumps “System” time 314 312 “Calendar” time 00:59:58 GMT 313 00:59:59 GMT …seconds since reference Daylight saving starts …on March 30, 2014
  • 28. Calendar time jumps “System” time 314 312 “Calendar” time 00:59:58 GMT 313 00:59:59 GMT …seconds since reference Daylight saving starts 02:00:00 BST …on March 30, 2014
  • 29. Calendar time jumps Managing calendar date and time is hard! … but is not our problem! … as long as we don’t use them!
  • 30. System time jumps “Absolute” time “System” time …ticks …seconds
  • 31. System time jumps “Absolute” time 26 …ticks “System” time 312 …seconds
  • 32. System time jumps “Absolute” time 26 “System” time 312 35 …ticks 313 …seconds
  • 33. System time jumps “Absolute” time 26 “System” time 312 35 44…ticks 313 …seconds
  • 34. System time jumps “Absolute” time 26 “System” time 35 44…ticks Network date update 312 313 …seconds
  • 35. System time jumps “Absolute” time 35 44…ticks 213 26 “System” time Network date update 312 313 …seconds
  • 36. Solution:! System time jumps 1. Do nothing 2. “Anchor” the time 3. Tell the user
  • 37. “Anchored” Time “Absolute” time 26 35 44…ticks +295 +295 +195…offset “System” time Network date update 312 313 213 …seconds since reference
  • 38. “Anchored” Time “Absolute” time 26 35 44…ticks 17 18 19…seconds since boot +295 +295 +195…offset “System” time Network date update 312 313 213 …seconds since reference
  • 39. “Anchored” Time Prepare:! ! double initialOffset = SystemTime() - AbsoluteTime(); ! Start recording:! ! // Wait for data! ! New data received:! ! double currentOffset = SystemTime() - AbsoluteTime(); double drift = currentOffset - initialOffset; double anchoredTimestamp = timestamp - drift;
  • 40. “Anchored” Time On iOS:! • Use CACurrentMediaTime() as AbsoluteTime(). • Use [NSDate timeIntervalSinceReferenceDate] as SystemTime(). ! On Android:! • Use SystemClock.elapsedRealtimeNanos() as AbsoluteTime(). • Use System.currentTimeMillis() as SystemTime(). • Also see Location.getElapsedRealtimeNanos().
  • 63. Distance calculation Remove points that! 1. have unacceptably low accuracy 2. are too close to the points before or after them Don’t remove points that! 1. the user has seen 2. are “too far”, unless you really know what you’re doing
  • 64. Distance calculation Location data point’s “accuracy”! is not a scientific error value.
  • 65. Distance calculation The Earth is not flat!! Don’t do cartesian maths.
  • 67.
  • 68. Watch the video with slide synchronization on InfoQ.com! http://www.infoq.com/presentations/sensors-tracking- user-activity