I\'ve been studying Android especially View system. I have a question differences between them but there is no documents or references in my mother language. So I want to kn
In addition to other answers, this could be beneficial for novice android developers or anyone who will see this.
In my case, using this snippet in OnCreate
method helped me to find out which device can use SurfaceView
if (
GLES20.glGetString(GLES20.GL_RENDERER) == null ||
GLES20.glGetString(GLES20.GL_VENDOR) == null ||
GLES20.glGetString(GLES20.GL_VERSION) == null ||
GLES20.glGetString(GLES20.GL_EXTENSIONS) == null ||
GLES10.glGetString(GLES10.GL_RENDERER) == null ||
GLES10.glGetString(GLES10.GL_VENDOR) == null ||
GLES10.glGetString(GLES10.GL_VERSION) == null ||
GLES10.glGetString(GLES10.GL_EXTENSIONS) == null) {
// try to use SurfaceView
} else {
// try to use TextureView
}
Hope it helps people who develop video player apps :)