I want to plot real time data from a bluetooth device. I have a Bluetooth device that the phone will connect to and read the data coming from it. The data is voltage levels from some sensors and having a sample rate of 300 samples per sec. Most of the plotting libs(like aiChart, Androidplot, achartengine,...) I have seen can't handle that amount of data and repainting the graph. So I looked into openGL and Android NDK and it seems that I might be able to graph using either one of these with the sample rates I have. Does anyone have a sample code for openGL line graph plotting in android/Java and/or NDK code sample?
相关问题
- How can I create this custom Bottom Navigation on
- Bottom Navigation View gets Shrink Down
- How to make that the snackbar action button be sho
- Listening to outgoing sms not working android
- How to create Circular view on android wear?
相关文章
- android开发 怎么把图片放入drawable的文件夹下
- android上如何获取/storage/emulated/下的文件列表
- androidStudio有个箭头不认识
- SQLite不能创建表
- Windows - Android SDK manager not listing any plat
- Mercurial Commit Charts / Graphs [closed]
- Animate Recycler View grid when number of columns
- Why is the app closing suddenly without showing an
We did something like this simply by creating a point array class with several pages and drawing in opengl with offset so the current point is always in the same place.
The idea use fixed size arrays with a separate counter so you aren't hitting memory alloc issues which would cause gc to kick in. Once a page is full, cycle to the next page displaying the old as well. The idea is that if you have 5 pages, you can write to one, display the other 3 and batch write the last one to sqlite on an sdcard in a seperate thread so you can pull all the data out later on.
As long as you only have one thread writing to the array you can get away with something like
Its very fast and should do what you need. You can then output as a point on a canvas or draw in opengl es
Hope that helps.