How to draw line by OpenGL ES in Android?

Dear All,
I am new to OpenGL ES. I want to plot a sin wave on android with following points:

{-3.14, -0.00159265}, {-2.826, -0.31038}, {-2.512, -0.588816}, {-2.198, -0.809672}, {-1.884, -0.951351}, {-1.57, -1.}, {-1.256, -0.950859}, {-0.942, -0.808736}, {-0.628, -0.587528}, {-0.314, -0.308866}, {4.44089*10^-16, 4.44089*10^-16}, {0.314,   0.308866}, {0.628, 0.587528}, {0.942, 0.808736}, {1.256,   0.950859}, {1.57, 1.}, {1.884, 0.951351}, {2.198, 0.809672}, {2.512,   0.588816}, {2.826, 0.31038}, {3.14, 0.00159265}

I want something similar to this:
[ATTACH=CONFIG]1634[/ATTACH]

I have created my main activity as:

public class MainActivity extends Activity {
	
	private GLSurfaceView surface;
	public void onCreate(Bundle bundle) {
		super.onCreate(bundle);
		surface = new GLSurfaceView(this);
		surface.setEGLContextClientVersion(2);
		surface.setRenderer(new Renderer());
		
		setContentView(surface);
	}
	
	public void onPause(){
		super.onPause();
		surface.onPause();		
	}
	
	public void onResume() {
		super.onResume();
		surface.onResume();
	}
}

I know I should create Renderer() and Line() classes and fragShader and vertShader but I do not know hot to do that. Would you please help me to write these 2 classes.

Thanks

Please read the Forum Posting Guidelines.

These forums are for asking specific technical questions related to OpenGL, not for finding folks that will do your work for you. You need find some good OpenGL ES on Android tutorials and sample programs (e.g. OpenGL ES 3.0 Programming Guide, or those from Google or the mobile GPU vendors) and do some reading.

Once you have specific OpenGL ES or EGL technical questions, you can try posting them to the Khronos OpenGL ES or EGL forums first (or to a mobile GPU vendor’s own discussion forums). But if you don’t get any response, feel free to re-post your question here as there is quite a bit in common between OpenGL ES and OpenGL.

OpenGL ES is OpenGL and questions are relevant here. It is a clean subset with no fixed function pipeline for vertex and fragment pipeline stages.

You seem to be missing some key concepts. First, plotting this function is a trivial vertex or fragment operation but it needs to be driven by the right data. You would not drive it with control points as that implies a subdivision stage of sorts which you don’t have. Second there are two main ways to do this, you either draw a line and apply a sine function in a vertex shader in which case you would need to supply a subdivided line, OR you supply a quad and rasterize the sin function and in that case you’d need to be concerned about the width of the line and shade as a function of proximity to the sun function.

So if plotting a line, simply draw a line with lots of tiny segments along the x axis and in the vertex shader implement y = sin(x), you would scale both x and y by some factor before and after the sun operation respectively or scale afterwards to a desired viewport with a matrix uniform.

If you wanted a control point based reconstruction you would draw a line, pass in control points as a uniform (or attributes plus weights) and implement your reconstruction filter in the shader instead of a sin function.