How to debug OPENGL ES 2.0 error on Nexus 4 without device?

I have an android app with tons of photos. Filters are implemented using OpenGL ES 2.0, so when I want to save the final image, I call glReadPixels. It works on every device I tested on, but it doesn’t seem to work on Nexus 4. Users say they can apply filters, but when they save the final image, they cannot find it on the devices. I want to know if I have a way to emulate nexus 4 and test the application on an emulator? I tested the emulator and it works great, and it would be nice to know if anyone has a similar problem with Nexus 4.

My request is glReadPixels.

GLES20.glReadPixels(0, 0, saveWidth, saveHeight, GLES20.GL_RGBA, GLES20.GL_UNSIGNED_BYTE, mPixels); 
+6
source share
1 answer

Add an additional log and ask some testing users to send you the result; this can help you narrow down your specific problem, be it with glReadPixels or save the file. In particular, use glGetError () and write its value and add try / catch blocks around the file I / O:

 try { .... file ops } catch (Exception e) { e.printStackTrace(); } 
+1
source

All Articles