Google Fit Api filter manually added activities

后端 未结 2 1543
遥遥无期
遥遥无期 2021-01-16 15:24

Google Fit allows users to add activities manually and programatically. Is it possible to filter out manually or programtically added activities from either the Android Api

2条回答
  •  清歌不尽
    2021-01-16 16:16

    There is no proper way according to the documentation. But I found some solution to identify manual and automatic tracked activities in Android API.

    DataSource ds = DataPoint.getOriginalDataSource()
    String streamData = ds.getStreamIdentifier()
    

    If "streamData" contains "user_input", then it assumes the activities to be manual activities, either it contains "detailed" for actual sensor recorded activities.

提交回复
热议问题