The app is getting data from Bluetooth and draws real-time graph.
However, the graph often gets the discontinuities.
The source of data is Bluetooth module (separate thread) and it fails to send all the data to SciChart lib. Frankly, when I insert Log.d()
line in the bluetooth thread to print the data, things start working fine magically.
I am suspecting that the Bluetooth thread does not get executed on time.
Here is some code that is part of Scichart modified by me in DataManager.java
file.
public void setSensingData(PBSensorData pbSensorData) {
try {
sensorDataQueueBlocking.put(pbSensorData);
} catch (InterruptedException e) {
e.printStackTrace();
}
// This is the magic line. When the line is here, things work fine
Log.d("DataManager", "put: " + (System.currentTimeMillis() - startTime) + " (ms)" );
startTime = System.currentTimeMillis();
}
Thank you in advance!