Skip to content

Instantly share code, notes, and snippets.

@masarugen
Created August 19, 2012 08:56
Show Gist options
  • Save masarugen/3393799 to your computer and use it in GitHub Desktop.
Save masarugen/3393799 to your computer and use it in GitHub Desktop.
/**
* センサーの取得値の更新
*/
@Override
public void onSensorChanged(SensorEvent event) {
if (event.sensor.getType() == Sensor.TYPE_ACCELEROMETER) {
float x = event.values[0];
float y = event.values[1];
float z = event.values[2];
Log.d(TAG, "x:" + x + ":y:" + y + ":z:" + z);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment