Skip to content

Adjust for unit mismatch: event.timestamp is in nanoseconds, not milliseconds

Henry Heino requested to merge updates/fix-units-sensor-activity-student into main

According to the Android documentation, event.timestamp is in nanoseconds. We compare it with System.currentTimeMillis, which is causing a bug.

It also seems that a value of 0 corresponds to when the device was first booted, rather than the Unix epoch (1970).

This merge request also adds an optional TODO suggesting that students move the hardcoded strings to strings.xml.

Edited by Henry Heino

Merge request reports