To help a buddy (r4sh44t) I’ve compiled some code pieces of how using the orientation (accelerometer) in Android. Just in case someone finds it useful.

Global variables that will be useful:

//Justo despues de la declaracion del activity (public class MICLASE extends Activity{ ) podemos declarar estas variables globales
//Just after the declaration of the activity (public class MYCLASS extends Activity{ ) we can declare these global variables
private SensorManager myManager;
private List sensors;
private Sensor oriSensor;
private float oldA;
private float oldP;
private float oldR;

Capturing the sensor:

//Capturar sensor de orientacion (en el onCreate!)
//Capture orientation sensor (in the onCreate!)
myManager = (SensorManager)getSystemService(Context.SENSOR_SERVICE);
sensors = myManager.getSensorList(Sensor.TYPE_ORIENTATION);
if(sensors.size() > 0)
{
oriSensor = sensors.get(0);
Toast.makeText(getApplicationContext(), "Sensor OK",
2).show();
}
else Toast.makeText(getApplicationContext(), "No Sensor", 2).show();
myManager.registerListener(mySensorListener, oriSensor,
SensorManager.SENSOR_DELAY_GAME);

Reading from the sensor:

//Leer del sensor
//Reading from the sensor
private final SensorEventListener mySensorListener = new SensorEventListener()
{
public void onSensorChanged(SensorEvent event)
{

//Aqui la funcion que usara los datos del sensor
//Here the function that will use the sensor data
yourFunctionThatUsesTheData(event.values[0],
event.values[1],
event.values[2]);;
}
public void onAccuracyChanged(Sensor sensor, int accuracy) {}
};

Using the data:

//Ejemplo de una funcion que use los datos, solo teniendo en cuenta el cambio desde la ultima vez que se leyó
//Example of a function that uses the data only using the difference of movement from the last read
private void yourFunctionThatUsesTheData (float a, float p, float r){
float thisA = a - oldA * 10;
float thisP = p - oldP * 10;
float thisR = r - oldR * 10;
oldA = a;
oldP = p;
oldR = r;

//Hacer cosas con estas variables
//Do stuff with these variables
}

And to understand what a p & r mean here you have a graphic: