Question

I have this line

manager.registerListener(sensorListener, manager.getDefaultSensor(Sensor.TYPE_PRESSURE), logTime);

where logTime = 300000000 microseconds = 5 minutes.

I am trying to log every 5 minutes but with this setup it logs every second or so. Do you know what could be wrong or how to solve this?

My manager is a SensorManager.

BR

Was it helpful?

Solution

Better setup for your task would be scheduled alarm waking up your application every 5 minutes. Then you can register listener and deregister it ater one sample is received.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top