title: Cannot access accelerometer in Cordova Android app
body: <p>I'm attempting to access navigator.accelerometer in my Cordova [3.3.1-0.1.2] Android app, and navigator.accelerometer is undefined when running in the Android [4.0.3] emulator.</p>
  
  <p>I followed this tutorial when setting up the Cordova app: <a href="http://www.techariv.in/2013/08/creating-android-hello-cordova.html" rel="nofollow">http://www.techariv.in/2013/08/creating-android-hello-cordova.html</a></p>
  
  <p>I added the following in www/config.xml inside of <code>&lt;widget&gt;</code>:</p>
  
  <pre><code>&lt;plugin name="Accelerometer" value="org.apache.cordova.AccelListener" /&gt;
  </code></pre>
  
  <p>I've also tried</p>
  
  <pre><code>&lt;plugin name="Accelerometer" value="CDVAccelerometer" /&gt;
  </code></pre>
  
  <p>Additionally, I have the following in www/js/index.js (which does load an execute):</p>
  
  <pre><code>onDeviceReady: function() {
      app.receivedEvent('deviceready');
  
      alert(navigator.accelerometer);
      navigator.accelerometer.getCurrentAcceleration(function() {
          alert('success');
      }, function() {
          alert('fail');
      });
  },
  </code></pre>
  
  <p>When the app runs, I get one alert which simply says "undefined." Neither callback to getCurrentAcceleration() is called.</p>
  
  <p>Note that onDeviceReady() is called via</p>
  
  <pre><code>document.addEventListener('deviceready', this.onDeviceReady, false)
  </code></pre>
  
  <p>(this is the standard "Hello World" app with no modifications besides adding the alerts and the accelerometer callback.</p>