Google fit API, onDatapoint method is not being invoked

别来无恙 提交于 2019-12-02 13:20:27
Matthew Woo

(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.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!