I am making a ECG graph display android application and extending surfaceView class and implement SurfaceHolder. Callback and using worker thread to lock canvas and and unlock as very common in game loop.
my class which extend surfaceView have draw function which draw line and this function is called by secondary thread to draw on lock canvas.
now my problem is that speed of drawing graph is so high. how i can control the speed of drawing .or can’t we control control worker thread speed ?
thanks in advance.
I have worked on ECG sensor before and I am pretty sure you can set a sampling rate in the sensor. Try decreasing the sampling rate and your application will automatically behave as you want.
Otherwise you can also take a look at a thread.sleep() method or use timer class and timer.schedule() method to run some code in specific intervals.