title: Android: GLES20: Called unimplemented OpenGL ES API
body: <p>I am getting a "Called unimplemented OpenGL ES API" error, when trying the GLES20 Sample, provided by developer.android.com. I modified the sample, though. 
  The reason was because 
  I got an IllegalArgumentException in GLSurfaceView.BaseConfigChooser.chooseconfig, so i replaced 
  <code>mGLSurfaceView.setEGLContextClientVersion( 2 );</code></p>
  
  <p>The new OnCreateMethod:</p>
  
  <pre><code>protected void onCreate( Bundle savedInstanceState )
  {
      super.onCreate( savedInstanceState );
      mGLSurfaceView = new GLSurfaceView( this );
  
      mGLSurfaceView.setEGLConfigChooser( new EGLConfigChooser()
      {
          @Override
          public EGLConfig chooseConfig( EGL10 egl, EGLDisplay display )
          {
              EGLConfig[] configs = new EGLConfig[1];
              int[] num_config = new int[1];
  
              boolean check = false;
  
              int[] configSpec = { EGL10.EGL_DEPTH_SIZE, 16, EGL10.EGL_NONE };
  
              check = egl.eglInitialize( display, new int[] { 2, 0 } );
  
              if ( !check )
                  return null;
              check = false;
  
              check = egl.eglChooseConfig( display, configSpec, configs, 1, num_config );
              if ( !check )
                  return null;
  
              return configs[0];
          }
      } );
  
      mGLSurfaceView.setEGLContextFactory( new EGLContextFactory()
      {
          @Override
          public void destroyContext( EGL10 egl, EGLDisplay display, EGLContext context )
          {
              egl.eglDestroyContext( display, context );
          }
  
          @Override
          public EGLContext createContext( EGL10 egl, EGLDisplay display, EGLConfig eglConfig )
          {
              int[] attrib_list = new int[]{EGL10.EGL_VERSION, 2, EGL10.EGL_NONE};
  
              EGLContext context = egl.eglCreateContext( display, eglConfig, EGL10.EGL_NO_CONTEXT, attrib_list  );
              return context;
          }
      });
  
      mGLSurfaceView.setRenderer( new GLES20TriangleRenderer( this ) );
  
      setContentView( mGLSurfaceView );
  }
  </code></pre>
  
  <p>The "Called unimplemented OpenGL ES API" error occurs for example at 
  <code>GLES20.glCreateShader;</code> or <code>GLES20.glShaderSource</code>. </p>
  
  <p>I thought, maybe to check the version, so I called 
  <code>gl.glGetString( GLES20.GL_VERSION );</code> in 
  <code>public void onSurfaceCreated( GL10 gl, EGLConfig config )</code>.
  glGetString returned "OpenGL ES-CM 1.0". OnSurfaceCreated is called after choosing the config and creating the context, so I really do not understand, why glGetString returns "OpenGL ES-CM 1.0".</p>
  
  <p>I am using Android 2.2 API and tried the sample on a Android 2.2 Virtual device and on a HTC Wildfire, with Android 2.2.1. </p>
  
  <p>I appreciate any help</p>