问题
I am currently working on an android application where I have to log all the sensor values. I got the sensor event timestamp from "event.timestamp" and I converted this value into a unix timestamp.
long currTimeRelativeToBootMs = SystemClock.uptimeMillis();
long currTimeAbsoluteMs = System.currentTimeMillis();
mStartTimeAbsoluteS = ((double)(currTimeAbsoluteMs - currTimeRelativeToBootMs))/(double)1000.0;
...
//timestampRelativeInNs = event.timestamp
double temp = mStartTimeAbsoluteS+((double)timestampRelativeInNs)/1000000000.0;
My application works fine on my HTC phone (Android 2.x.x) but it did not work on the new Google Nexus7.
I compared the "event.timestamp"-values from the different devices. I started the devices approximately at the same time but I got rather different values. The one from the Nexus7 is longer by 4 figures .....
SensorEvent-Timestamp(HTC): 175120992123000
SensorEvent-Timestamp(Nex): 1355418999245703000
What could be the reason for that issue??? How can I fix that???
来源:https://stackoverflow.com/questions/14126068/android-sensorevent-timestamp-issue