public static int compileShader(@ShaderType final int shaderType, final String shaderSource) {
		int shaderHandle = GLES20.glCreateShader(shaderType);

		if (shaderHandle != 0) {
			GLES20.glShaderSource(shaderHandle, shaderSource);

			GLES20.glCompileShader(shaderHandle);

			final int[] compilationStatus = new int[1];
			GLES20.glGetShaderiv(shaderHandle, GLES20.GL_COMPILE_STATUS, compilationStatus, 0);

			if (compilationStatus[0] == 0) {
				Timber.e("Error compiling shader %s", GLES20.glGetShaderInfoLog(shaderHandle));
				GLES20.glDeleteShader(shaderHandle);
				shaderHandle = 0;
			}
		}

		if (shaderHandle == 0) {
			throw new RuntimeException("Error creating shader.");
		}
		
		return shaderHandle;
	}
Helper function to compile a shader.

@param shaderType The shader type.
@param shaderSource The shader source code.
@return An OpenGL handle to the shader.
library/src/main/java/com/yalantis/starwars/utils/gl/ShaderHelper.java