Fetching Google Fit Data into android application

后端 未结 5 1951
庸人自扰
庸人自扰 2021-01-14 09:08

How can we get the data stored in google fit cloud for a specific user? I tried using History API but no data is being displayed. Then i tried entering some data vai History

5条回答
  •  萌比男神i
    2021-01-14 09:58

    I really don't understand how to insert the step counter value inside the insertFitnessData(). Basic History google program already has a DataSet that holds a step value of 1000. How should I change that part so it can count the steps that I am doing over the last hour?

        DataSet dataSet = DataSet.create(dataSource);
        // For each data point, specify a start time, end time, and the data  
        value -- in this case,
        // the number of new steps.
        DataPoint dataPoint = dataSet.createDataPoint()
                .setTimeInterval(startTime, endTime, TimeUnit.MILLISECONDS);
    

    Should I use the OnDataPointListener to recieve callbacks? I m confused!

提交回复
热议问题