title: What is the right way to choose an EGL config in Android?
body: <p>I'm using my own GLSurfaceView and have been struggling with crashes related to the EGL config chooser for a while.</p>
  
  <p>It seems as though requesting RGB_565 by calling <code>setEGLConfigChooser(5, 6, 5, 0, 16, 0)</code> should be the most supported. However, running this code on the emulator using host GPU I still get a crash, seemingly because my graphics card does not natively support RGB_565. Setting to RGBA_8888 by calling <code>setEGLConfigChooser(8, 8, 8, 8, 16, 0)</code> seems to run fine on my emulator and HTC Rezound device, but I'm seeing a small number of crash reports in the market still.</p>
  
  <p>My guess is that most phones support RGBA_8888 natively now but a small number of my users have phones which are only compatible with RGB_565, which prevents my config chooser from getting a config.</p>
  
  <p>Seeing as how I don't need the alpha channel, is there a right way to try RGBA_8888 first and then fall back to RGB_565? Is there a cleaner way to just ask for any ol' config without caring about the alpha value?</p>
  
  <p>I saw a possible solution to determine ahead of time what the default display config was and request that specifically here: <a href="https://stackoverflow.com/a/20918779/234256">https://stackoverflow.com/a/20918779/234256</a>. Unfortunately, it looks like the suggested getPixelFormat function is deprecated as of API level 17.</p>