Search code examples
androidandroid-sensors

Which sensor for rotating android?


Hi which sensor(s) would I need to manage for my joystick app to capture the following movement;

Device is in landscape, held in front of you with both hands with the device tilted forward towards TV i.e. somewhat gamepad like.

Now push or pull left or right edge of device away or towards you.

Thanks,


Solution

  • You can use the accelerometer sensor to capture the x, y and z position of device