I’m creating an application for Android for API levels >= 7. One screen uses a GLSurfaceView with OpenGL ES 2.0 through the NDK. How can I detect if OpenGL 2.0 is available? I can’t use android:glEsVersion="0x00020000" in my AndroidManifest.xml because I have to support all phones with API levels >= 7. If there is no support for 2.0, I will be showing a static screen.
I’m using similar code from the hello-gl2 sample app that comes with the NDK. In GL2JNIView, when it sets the OpenGL context, if it doesn’t find an appropriate OpenGL config (in my case a config that requires OpenGL ES 2.0) it throws an IllegalArgumentException("No configs match configSpec") and the app crashes. I can’t find a way to intercept that exception and do something else on that screen. Any ideas?
Here’s what I found in internets:
Source: http://www.badlogicgames.com/wordpress/?p=343