This seems like a basic question, but after searching for a while and playing with it, I\'ve come to the point where some help would be appreciated. I would like to have a
You can receive sensor event in a background thread. Instead of
mSensorManager.registerListener(msl, mSensor, SensorManager.SENSOR_DELAY_UI );
you can declare it with a handler referring to a secondary thread. The run loop of a thread looks like this:
...
run {
Looper.prepare;
Handler handler = new Handler();
...
mSensorManager.registerListener(msl, mSensor, SensorManager.SENSOR_DELAY_UI, handler );
Looper.loop();
}
...