问题
I'm developing a fitness app for Android devices to track activities like running or bikings and discovered that Google Fit API can help me a lot doing it. But when I started playing with the Google samples from GitHub, I found a few problems in my way.
Firstly, it doesn't seem to work well with the Android Emulator. I activate the SensorsAPI to get GPS updates with a listener but it doesn't return any DataPoints. When running on a real device it seems to work a little bit better, though.
My second doubt is about how could I get the calories burned during the activity? Is it possible for Google Fit to get it automatically for me, only having to insert the height and the weight of the user? If that's possible, does it work only for history sessions or can I get it for the actual activity the user is doing, with the SensorsAPI? Because in my app, I want to show information abour the current activity in real-time (duration of the activity, distance covered, calories burned ...)
And lastly, I'd also like to show a map of the route of the activity for the user when he checks the history sessions stored in the Google Fit SDK, maybe even a map in real-time during the activity. Is there anything in Google Fit API that could give me the map automatically or the only way is to retrieve all the localization points recorded durint the activity session and then draw a map with them?
Thanks a lot for the help!
来源:https://stackoverflow.com/questions/33923367/google-fit-api-get-distance-calories-speed-when-tracking-running-biking