How to create ECG animation on Android Application

前端 未结 2 499
余生分开走
余生分开走 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: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

提交回复
热议问题