How to create ECG animation on Android Application

前端 未结 2 503
余生分开走
余生分开走 2021-02-06 15:44

I coded an android application which is measuring heart rate from camera input. I needed to desing an ECG animation to the application. I know that ECG isn\'t related. But I\'ll

相关标签:
2条回答
  • 2021-02-06 16:05

    To do real time graphing of ECG data...which is what I am coding right now, you need to create a custom view. Then in the onDraw method you use your canvas to draw a bitmap. Then inside the custom I also implement a Runnable that paints the line using drawline, and then invalidates(). I'd show you code but its proprietary since everything I found did not measure up to the speeds I had to graph.

    0 讨论(0)
  • 2021-02-06 16:10

    It depends how real-time you need your data. If a lower framerate is sufficient, then I would recommended subclassing the View class and overriding the onDraw method. From there you can draw directly onto the canvas. Just make sure to call invalidate on the view after your data changes to make sure onDraw gets called.

    If a faster framerate is required, then you probably want to use a SurfaceView. Google has a Lunar Lander example that does a good job of that. But note some bugs have been found in the example, so use it as a guide not as law.

    Lunar Lander: http://developer.android.com/resources/samples/LunarLander/index.html

    0 讨论(0)
提交回复
热议问题