title: How to detect phone tilt?
body: <p>How to determine the angle of the phone orientation in the one plane?</p>
  
  <p>Now I make it through SensorManager:</p>
  
  <pre><code>mSensorManager = (SensorManager) getSystemService(Context.SENSOR_SERVICE);
  mOrientation = mSensorManager.getDefaultSensor(Sensor.TYPE_ORIENTATION);
  
  ...
  
  public void onSensorChanged(SensorEvent event) {
      xy_angle = event.values[0]; 
      xz_angle = event.values[1]; 
      zy_angle = event.values[2]; 
  </code></pre>
  
  <p>Here I get different angles, but I need only one angle, which varies with the rotation of the phone, while driving along the blue line.</p>
  
  <p>How calc or how get this angle?</p>
  
  <p><img src="https://i.stack.imgur.com/kCElj.jpg" alt="http://i.stack.imgur.com/kCElj.jpg"></p>
  
  <p><a href="https://stackoverflow.com/questions/4576493/how-can-i-use-sensormanager-getorientation-for-tilt-controls-like-my-paper-plan">How can I use SensorManager.getOrientation for tilt controls like &quot;My Paper Plane&quot;?</a> - similar question here, but I don't understand how author solve his problem.</p>