1

I have an app that logs acceleration, rotation and gps data. The data is written to a log file on the sd card. When i plot the data on pc i see that the logging of acceleration and rotation data is suspended randomly for 10-100 seconds. The gps data is nearly equidistant.

It's implemented as one background service that listens to sensor-events and location-events. I know that there is a bug with getting sensor data when screen is off. But I'm using a Nexus 5 where it should work.

At the green line (acceleration) you see the problem. Sometimes it's suspended.

enter image description here

Any suggestions for solving this problem?

user3603632
  • 437
  • 4
  • 17
  • no ideas? I would be happy if someone can tell me, what I can try. – user3603632 May 09 '14 at 08:01
  • I found this: [link](http://stackoverflow.com/questions/11612065/obtaining-sensors-data-while-the-screen-is-off-android-4-0/23616068#23616068) So i tried to do this in onStartCommand(..): final PowerManager pm = (PowerManager) getSystemService(Context.POWER_SERVICE); wakeLock = pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, "logging service lock"); wakeLock.acquire(); And this in onDestroy: wakeLock.release(); But it did not help. Any ideas? – user3603632 May 12 '14 at 19:31
  • How to get timestamps of sensors for yourself or from android API? – jakeoung Apr 02 '15 at 01:15

0 Answers0