title: How to implement gyroscope sensor in android?
body: <p>I'm trying to write the simplest implementation of the gyroscope (only to log the orientation of the screen when it's changed). Could someone provide a simple example of this?</p>
  
  <hr>
  
  <p>This is what I'm trying right now:</p>
  
  <pre><code>public class LessonFiveGLSurfaceView extends GLSurfaceView implements SensorEventListener 
          {
          private LessonFiveRenderer mRenderer;
  
          public LessonFiveGLSurfaceView(Context context) 
          {
              super(context); 
              System.out.println("test");
          }
          @Override  
          public void onSensorChanged(SensorEvent event)  
          {  
              //output the Roll, Pitch and Yawn values  
              System.out.println("Orientation X (Roll) :"+ Float.toString(event.values[2]) +"\n"+  
                         "Orientation Y (Pitch) :"+ Float.toString(event.values[1]) +"\n"+  
                         "Orientation Z (Yaw) :"+ Float.toString(event.values[0]));  
          }  
  </code></pre>
  
  <p>However I'm getting error: "The type LessonFiveGLSurfaceView must implement the inherited abstract method SensorEventListener.onAccuracyChanged(Sensor, int)".</p>