From the smartphone by using HistoryAPI
If I ask for user's history and DataType.TYPE_HEART_RATE_BPM
for the last past hour, starting from the current time, I miss data from the last half hour.
If I ask them to Google Fit with the same procedure from the smartwatch it's all fine.
So it's not a matter of data fetching because it depends on device.
Maybe it's a problem of synchronization? How do I programmatically force an update of records in the repository of Google Fitness Store?
This is what I'm talking about.
EDIT: this is how I build a request
DataReadRequest readRequest = new DataReadRequest.Builder()
.setTimeRange(startTime, endTime, TimeUnit.MILLISECONDS)
.enableServerQueries()
.read(dataType)
.build();
Have you given the devices enough time to synchronize all data before making a request? When you request data from the HistoryAPI on the phone it will be fetched from the cloud. However, when you request data from the watch it will only be local data from that wearable device. If the devices have been out of range I assume that it would take some time, after re-connecting, before the watch data is available in the cloud. As far as I know there's no way of forcing such an update to happen faster/on demand.
A possible workaround would be to check the time stamp of the data points and use local data on the watch if there's data missing from the request made on the phone.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With