问题
I'm developing a recording app, for which I am trying plot amplitude of audio recording samples against time on Android View similar to below image.
The graph should move with time towards the left side of the screen.
I tried using LineChart of MPChart Library but still, the result is not as expected.
MPChart homepage has a screenshot of such graph, but couldn't figure it how to implement.
Please help. Thank you.
回答1:
You can use LineChart for that, here is official RealtimeLineChartActivity
:
Oficial RealtimeLineChartActivity example
Like in the sample, you should feed (feedMultiple
method) it with data from other Thread, periodically (Runnable)
Hope that helps
来源:https://stackoverflow.com/questions/50508159/plotting-android-recording-sampless-amplitude-on-moving-graph-realtime