Sensor Applications · Study deck
Mobile Sensor APIs: Measurements and Evidence
This first route maps mobile API families to real sensors and derived values, then checks permission, context, timing, units, frames, and batching.
Physics Phoebe is your guide for this deck.

After studying this chapter
Learning objectives
You will be able to:
- Identify common mobile sensor API families and the measurements they expose.
- Explain the permission and secure-context checks that gate mobile sensor access.
- Compare browser-based sensing with native mobile access for an IoT use case.
- Review mobile sensor data for timestamp, units, accuracy, context, and failure states.
Major section
Begin With One Phone Reading
An API means a set of rules that lets one piece of software ask another for data or an action.
- You want its motion reading to mark a rough stop or turn.
- A sound plan records each state instead of filling a gap with made-up data.
- A clear app should show each state.
Major section
Begin With One Phone Reading (continued)
It also says when a web page is enough and when a native app is needed.
- More access may give more data, but it also raises privacy, battery, and support costs.
- This short story does not prove that the phone is a calibrated field tool.
- It should not ask for more access than the task needs.
Major section
Minimum Viable Understanding
Permission, browser support, secure context, and foreground state can all determine whether a reading is available.
- Even a successful API value needs units, timestamps, accuracy fields, calibration context, and validation before it becomes trustworthy evidence.
- Browser APIs fit scoped collection, demonstrations, and lightweight field forms.
- Native APIs become relevant when the project requires deeper platform integration, richer lifecycle control, or access the browser does not expose.
Major section
API Access Model
Units, timestamp, accuracy, and context then give that stream meaning before a stop condition closes the collection window.
- The failure branch is equally important: denial and unsupported states remain part of the record.
- This ordered path connects API selection to the quality evidence and lifecycle boundaries needed by the sensing claim.
Major section
Common Mobile API Families
Where a Location Fix Actually Comes From walks through what technique is actually running behind that coordinate, indoors and out, and why a raw fix still needs filtering before it becomes a track.
- Motion and orientation APIs may expose acceleration, rotation rate, and device orientation events depending on platform support.
- Phone placement—hand-held, pocketed, mounted, or on a table—sets what the signal can represent.
- A reference movement or validation reading should then show that the recorded direction and scale are plausible.
- Camera and microphone APIs can support visual or audio sensing, but they carry stronger privacy and context concerns.
Major section
Browser Or Native Path
The browser path and native path can both be valid, so the choice should follow the measurement need and review evidence.
- The design must still handle permission denial and unsupported states.
- That benefit carries platform-specific maintenance and testing obligations.
Major section
Browser Or Native Path (continued)
Native access becomes relevant when the required sensor is not exposed to the browser, when collection must survive app-state changes, or when local storage, notifications, and device services need tighter platform integration.
- The deciding path is the first one that satisfies the evidence and operational boundary, not the one that sounds more advanced.
- This makes the implementation choice part of the measurement record and exposes when a browser page cannot meet the required lifecycle behaviour.
- Older mobile-web stacks such as Wireless Application Protocol (WAP) and Wireless Markup Language (WML) are useful mainly as historical architecture context.
Major section
Data Quality Review
Mobile sensor readings should be reviewed before they are used as evidence.
- Preserve accuracy or uncertainty when the API exposes it, especially for location, and describe how the phone was held, worn, mounted, or positioned.
- Permission state must distinguish granted, denied, unavailable, and unsupported outcomes.
- Close the record with the collection window and its stop reason, then add a known movement, known location, comparison reading, or plausibility check as validation evidence.
Major section
Common Mistakes
Coordinates without accuracy and time are incomplete; motion values without phone placement are ambiguous.
- Browser support varies, so denied, unsupported, stale, and interrupted states must remain visible.
- Narrow phone data cannot justify broad activity, safety, or health claims.
- Every collection plan also needs an explicit stop condition and a retest trigger so changed access or setup cannot silently inherit an old conclusion.
Major section
A Phone Reports More Sensors Than It Has
The fused output is an inference whose failure modes include the inputs and the algorithm, not a separate physical chip.
- This connects API selection to the chapter's requirement to record signal type and provenance.
Deck summary
Key takeaways
An API means a set of rules that lets one piece of software ask another for data or an action.
- It also says when a web page is enough and when a native app is needed.
- Permission, browser support, secure context, and foreground state can all determine whether a reading is available.
- Units, timestamp, accuracy, and context then give that stream meaning before a stop condition closes the collection window.
- Where a Location Fix Actually Comes From walks through what technique is actually running behind that coordinate, indoors and out, and why a raw fix still needs filtering before it becomes a track.
Retrieval practice
Recall check 1 of 4

Physics Phoebe says: answer from memory, then check your reasoning.
Q1A browser-based lab needs device orientation data, but the user denies permission. What should the record show?
Show answer
Answer: B Mobile sensor API choices must record secure-context, permission, availability, sampling, data format, and failure states.
Retrieval practice
Recall check 2 of 4

Physics Phoebe says: answer from memory, then check your reasoning.
Q2On a phone, a 'linear acceleration' or 'rotation vector' sensor is best described as what?
Show answer
Answer: C Fused sensors are algorithmic combinations of raw accelerometer, gyroscope, and magnetometer data.
Retrieval practice
Recall check 3 of 4

Physics Phoebe says: answer from memory, then check your reasoning.
Q3A resting phone's raw accelerometer reads about 9.8 m/s² along one axis. A developer logs this as 'the phone accelerated hard.' What went wrong?
Show answer
Answer: D Raw acceleration bundles gravity with motion; the gravity-removed linear acceleration value would be near zero, showing no real motion.
Retrieval practice
Recall check 4 of 4

Physics Phoebe says: answer from memory, then check your reasoning.
Q4A fitness app integrates gyroscope data assuming a fixed 10 ms interval, but the OS batches sensor events through a sensor hub to save power. Why do the results drift?
Show answer
Answer: D Best-effort, batched delivery means intervals vary; always use the reported timestamps, not an assumed dt.
Print reference
Answers
Answer key.
- B · Mobile sensor API choices must record secure-context, permission, availability, sampling, data format, and failure states.
- C · Fused sensors are algorithmic combinations of raw accelerometer, gyroscope, and magnetometer data.
- D · Raw acceleration bundles gravity with motion; the gravity-removed linear acceleration value would be near zero, showing no real motion.
- D · Best-effort, batched delivery means intervals vary; always use the reported timestamps, not an assumed dt.