For my project i've created a class that uses the Sensors of the users device to detect north. I only need to get an update every second, and hopefully by making the delay longer save some battery, but I cant get the delay working. What i have:
mAcceleroSensor = mSensorManagerAccelero.getDefaultSensor(Sensor.TYPE_MAGNETIC_FIELD);
mMagneticSensor = mSensorManagerMagnetic.getDefaultSensor(Sensor.TYPE_ACCELEROMETER);
// Tried to set normal values like SensorManager.SENSOR_DELAY_NORMAL
// and numbers like 100 - 100.000. 1.0000.0000
// (without the dots only here to make it readable here).
mSensorManagerAccelero.registerListener(this, mAcceleroSensor, 50000000);
mSensorManagerMagnetic.registerListener(this, mMagneticSensor, 50000000);
Everything works except the delay it almost looks like its updated live. I have used code similair to https://stackoverflow.com/a/23060896/1667868 with some minour changes.
Note: the minimum api version I use is 14