问题
I'm developing an app for Android Wear on Samsung Gear Live (Google I/O Edition) where it will need access heart rate and steps count history data. I know that later this data might be accessible using Google Fit SDK, but is it possible to read that data without using that SDK right now?
I would prefer to access this data without ROOTing my G Watch.
Here are the screenshots of the historical data that I would like to extract:
Steps History data:
Heart Rate History Data:
UPDATE 10/28/2014
Google Release Google Fit SDK Available on the Official website
回答1:
I guess the only option right now is for you to create your own heart rate and step counter apps that share historical data through content providers. I've written a quick tutorial on how to get data from heart rate sensor here.
回答2:
As far as I've been able to tell, there's no public api that accesses the fitness data from the watch. I'm fairly confident that will become available when the Fitness SDK opens up, but that may be a while.
Until then, the only way I believe you can access that data is by reading the fitness app's private sqlite database. Unfortunately, you will need root to access it. It's located at:
/data/data/com.google.android.apps.fitness/databases/pedometer.db
It contains two tables worth looking at: heartrate and stepcount. Both are very simple. (Note: this is taken from a G Watch, and both tables exist, but the heartrate data is empty, as you would expect.)
I'm going to keep poking around in the apks to figure out of there's a queryable service, but I haven't seen one yet.
来源:https://stackoverflow.com/questions/24603535/access-android-wear-fit-data