title: Smoothly move Image with accelerometer in android
body: <p>I am building an android application similar to x-ray scanner (<a href="https://play.google.com/store/apps/details?id=net.kreci.xray&amp;hl=en" rel="nofollow">Play Store Link</a>), which moves images smoothly on screen by moving the device left,right top and bottom. </p>
  
  <p>I am using accelerometer for this, but problem is that image is not moving smoothly.
  My code is below</p>
  
  <pre><code>int x1 = (int) sensorEvent.values[0]*(screenW/10);
  int y1 = (int) sensorEvent.values[1]*(screenH/14);
  </code></pre>
  
  <p>and then in on Draw
  <code>canvas.drawBitmap(bmp, x, y, mPaint);</code></p>