I'm trying to develop a service on android2.1 which can detect the movement of device in anytime. However, my service can't receive the X, Y, Z data in onSensorChanged method, and WindowOrientationListener in framework is received the data normally.
I put some log in the codes and found that the FileDescriptor (handle->data[offset++]) in sensor_data_open in SensorManager.cpp passed from SensorManager.java isn't consistent with the FileDescriptor (handle->data[0]) sent by android_open method in SensorService.cpp when I register SensorEventListener in my service. But the FileDescriptor is consistent in the WindowOrientationListener.
Does someone has any idea about it??