Preventing devices without a GL extension from dow

2019-07-21 09:27发布

问题:

Is it possible to make an app unavailable for devices without a specific OpenGL ES extension on Google Play store?

Since <supports-gl-texture> takes the extension name, not the texture format, can it be exploited for generic GLES extensions?

回答1:

Yes I believe there is, for example:

<uses-feature android:glEsVersion="0x00020000" android:required="true" />

This statement will prevent devices that do not support OpenGL es 2.0 from seeing your app in the playstore.

Try this:

String extensions = javax.microedition.khronos.opengles.GL10.glGetString(
        GL10.GL_EXTENSIONS);

According to the docs, the extensions variable will contain a space-separated list of supported extensions to GL. So I think you can just use .contains("GL_OES_depth24"); or something. You're going to have to check some example content of whats returned to see how to check for it.

I don't know how to stop the app from coming up in google play store but you can just put this check at the beginning of your app that will tell users that you can't use this app or something.