-1

I'm developing an application to get the daily step count, calories, distance and active time from Google Fit. I calculated all of the above except for the active time. How can I do that?

I also want to know, if I got e.g. 500 steps, what the activity type is (walking/running).

Any help is appreciated

TofferJ
  • 4,678
  • 1
  • 37
  • 49
  • Please let us know what you've tried so far and try to give some more details about why it's not working for you. Posting some code is usually a good way to make it easier for the people who are trying to help you. – TofferJ Jul 10 '17 at 22:34

1 Answers1

0

There's no way (afaik) to get the active time directly from the Google Fit API. You will have to get the duration of each of the recorded activities and add them together. (See sample code in this answer)

For the second question, each recorded data point should have an activity type field. You can find a list of all of them here. Just keep in mind that you can't assume that all steps comes from the activity. Again you have to look at all the recorded activities individually.

TofferJ
  • 4,678
  • 1
  • 37
  • 49