Hi, I am currently developing an app which starts a service that runs through the night. This service is an intent service implementing a SensorEventListener (with its corresponding overriden functions: onSensorChanged(SensorEvent event) and onAccuracyChanged(Sensor sensor, int accuracy) ). When it starts, it registers the accelerometer and the heart rate sensors, and saves these values into a file every 500 ms. If I test it within few minutes, say 5 minutes, the behaviour of the service is good, but when it runs for more time, the values within the event object inside the 'onSensorchanged' are the same during randomly long periods.
If I run the app (and the service) at the beginning of the night and stop it in the morning, the file that it writes has huge blocks of data where the timestamp and the value of the event are exactly the same. This means, the file presents a signal which has flat parts, randomly long. I don't really know why is this happening and how could I solve it. I have tried so many things that I don't even recall what I did. If somebody knows why is this happening, please help me see the error here. If you need more information or code, don't hesitate on asking me. Thanks! -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscr...@googlegroups.com. To post to this group, send email to android-developers@googlegroups.com. Visit this group at https://groups.google.com/group/android-developers. To view this discussion on the web visit https://groups.google.com/d/msgid/android-developers/80865469-ef47-4697-b666-8b766023119c%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.