The problem may be with the frequency of the accelerometer. Do not use below android constants when registering.
mSensorManager.registerListener(this, mAccelerometer, SensorManager.SENSOR_DELAY_NORMAL);
These icons are different for different devices.
int SENSOR_DELAY_FASTEST get sensor data as fast as possible int SENSOR_DELAY_GAME rate suitable for games int SENSOR_DELAY_NORMAL rate (default) suitable for screen orientation changes int SENSOR_DELAY_UI rate suitable for the user interface
Use hard-coded values in microseconds, for example, for a frequency of 1 Hz
mSensorManager.registerListener(this, mAccelerometer,1000000);
Hope he solves.
nayab source share