How should I determine direction from a phone's orientation & accelerometer?
- by Manoj Kumar
I have an Android application which moves a ball based on the orientation of the phone. I've been using the following code to extract the data - but how do I use it to determine what direction the ball should actually travel in?
public void onSensorChanged(int sensor, float[] values) {
// TODO Auto-generated method stub
synchronized (this)…