title: how to calibrate the orientation sensor in android?
body: <p>I'm writing an app in Google Android 2.1 that needs to know which direction (n/w/s/e) the device (HTC Hero) is facing. The sensor and its listener are working great, but the values I get from the sensor are totally crappy. e.g. it tells me I'd be facing north when the device is facing SW or so...</p>
  
  <p>This seems to be a known problem with android devices. The "solutions" I found on the web look like this:</p>
  
  <ul>
  <li>shake the device around</li>
  <li>move the device like an eight</li>
  <li>tap on the devices back</li>
  </ul>
  
  <p>This is thought to trigger the sensors recalibration. And: the thing with the "moving around" works for me... but that's not very professional I guess...</p>
  
  <p>so - how do I trigger the recalibration of the orientation sensor from the SDK? I need the sensor to be properly calibrated without any fancy stuff that would make users of this app look like complete idiots while they are "manually" recalibrating their phones...</p>
  
  <p>Is there any way to do this "right"?</p>
  
  <p>EDIT:</p>
  
  <p>Or: is there any way to determine PROGRAMMATICALLY, if the device is correctly calibrated or not? As a fallback-option so to speak... then I could warn the user that the device needs "manual" recalibration.</p>