public void onSensorChanged(SensorEvent event) {
Sensor sensor = event.sensor;
if (event.sensor.getType() == Sensor.TYPE_ACCELEROMETER) {
accelXValue = (int) event.values[0];
accelYValue = (int) event.values[1];
accelZValue = (int) event.values[2];
System.out.println("accelXValue=" + accelXValue);
System.out.println("accelYValue=" + accelYValue);
System.out.println("accelZValue=" + accelZValue);
}
tvAX.setText(Double.toString(accelXValue));
tvAY.setText(Double.toString(accelYValue));
tvAZ.setText(Double.toString(accelZValue));
}