Package com. example. groupactiontest; import com. badlogic. gdx. applicationListener; import com. badlogic. gdx. gdx; import com. badlogic. gdx. input. keys; import com. badlogic. gdx. input. peripheral; import com. badlogic. gdx. graphics. GL10; public class MyGame implements ApplicationListener {@ Overridepublic void create () {// System. out. println ("available:" + Gdx. input. isPeripheralAvailable (Peripheral. accelerometer); // System. out. println ("Gdx. input. getNativeOrientation (): "+ Gdx. input. getNativeOrientation (); System. out. println ("Peripheral. compass available: "+ Gdx. input. isPeripheralAvailable (Peripheral. compass); float azimuth = Gdx. input. getAzimuth (); float pitch = Gdx. input. getPitch (); float rool = Gdx. input. getRoll (); System. out. println (azimuth + "," + pitch + "," + rool) ;}@ Overridepublic void dispose () {// TODO Auto-generated method stub} @ Overridepublic void pause () {// TODO Auto-generated method stub} @ Overridepublic void render () {Gdx. gl. glClear (GL10.GL _ COLOR_BUFFER_BIT); // return the value of gravity acceleration at a certain point. out. println ("x:" + Gdx. input. getAccelerometerX () + "y:" + Gdx. input. getAccelerometerY () + "z:" + Gdx. input. getAccelerometerZ ();} @ Overridepublic void resize (int arg0, int arg1) {// TODO Auto-generated method stub} @ Overridepublic void resume () {// TODO Auto-generated method stub }}