I am newbi in developing using Google Fit API. I have been reading the Fit API documentation many times, but don't really understand about this thing.
I want to get the value of user's step, so I am using History API to query it. I can get the same value as what Fit App shows (using the same way as in the sample that is provided by google).
However, when I sync-ed data from the other app (in my case, I sync-ed it with FitToFit, a 3rd party app that integrate Fitbit to Fit app), the AppPackageName of the Datapoint in that period of time changed.
could it be because the FitToFit app updated the data in the Google Fit server? If yes, does it mean we can not get the original data from the smartphone sensor anymore after sync-ing with other app?
And one more question, if I add step value directly as user input to Fit App, will it also update the Datapoint in the Google Fit server on that period of time?
Based from the documentation:
Every data point in Google Fit has an associated data source. Data sources contain information to identify the app or the device that collects or transforms the data. The package name of the app is available for data sources that don't represent a physical sensor.
Google Fit enables you to:
- Determine which app inserted fitness data.
- Fire an intent to view fitness data with a specific app.
- Receive intents to show fitness data using your app.
Which means if you change your app synced, the Datapoint will also change. For example, an app that analyzes a variety of data from the user's fitness history may want to present users with the list of fitness sessions included in the analysis, along with information about which app inserted each session. When users tap on each session, the app can fire an intent to show a detailed view of the session using a different app