I want to make an app which shows cardio graph in real time. That means i want to measure heart bit and want to show the bit rate in graph in my application. But i wondering to draw the cardio graph. I have gone through many sample graph codes but dint get any clue to draw cardio graph. Is there any clue from any body?
Share
For this specific application, you may want to draw the graph “by hand” using Path and a SurfaceView.
Get a Paint instance ready during initialization:
When you need to update the graphic, clear the scene and build the line path (adapt this to your needs) :
You may also use quadTo or cubicTo instead of lineTo.
If you want your graph to have a realtime animation effect (i.e. sliding to the left while data is coming on the right), you may draw on a SurfaceView in a similar way to the famous LunarLander example (following code is a simplified version):
Where mSurfaceHolder is obtained by calling
yourSurfaceView.getHolder()anddoDrawis whereyou call
canvas.drawPath()and all your drawing code.