I am not able to get step count. I\'ve been stuck on getting the onDataPoint
method to be called. This code is almost correct. I am not able to find why it is not s
(As solved in the comments) The issue is that TYPE_STEP_COUNT_CUMULATIVE
is not a raw data type—Google uses a combination of sensors, accelerometer, machine learning, etc. to determine step count. So the .setDataSourceTypes(DataSource.TYPE_RAW)
line needs to be removed.
OP noticed that just removing the line gives less accurate results than replacing it with DataSource.TYPE_DERIVED
.
Also, the Google Fit FAQ has an example which uses TYPE_DERIVED
.