I am just curious if my app would work out this way to make it vibrate when the phone is shook:
if(event.values[0] > 1.0) {
vibrator.vibrate(500);
}
else {
if(event.values[1] > 1.0)
vibrator.vibrate(500);
}
What I am doing is SensorEventListener
and I and combining 2 listeners.
Will this work out doing it this way? I am unable to test it as I don't own an Android phone, so I am asking (programming-wise) if this is possible.