google-fit

Google Fit Api 403 Error from remote client

限于喜欢 提交于 2019-12-13 04:55:06
问题 I have a web app hosted on IIS 7 that is doing Http calls using the Google Fit API, I'm able to successfully send a POST and retrieve an access token, after which I do a GET for the following uri: "https://www.googleapis.com/fitness/v1/users/me/dataSources/raw:com.google.weight:com.google.android.apps.fitness:user_input/datasets/00-1427209862000000000" Here's how I build a request and look at the response: request = (HttpWebRequest)WebRequest.Create(uri); request.Method = "GET"; request

Documentation for Google FIT REST API dataset:aggregate

不羁的心 提交于 2019-12-12 18:32:48
问题 I am trying to get data from Google Fit using REST API. I am able to get individual data points for steps and calories through the documented REST APIs. However,I want them aggregated by day. I see the following resource in the Oauth2 playground: https://www.googleapis.com/fitness/v1/users/{userId}/dataset:aggregate However, I was not able to find any documentation on how to use this. Has anyone been successful in using this REST resource? Any pointers to the documentation / any examples

Google fit api steps returns 0 for some users

心不动则不痛 提交于 2019-12-12 03:38:30
问题 I am developing an android app that will count steps for users. I am using google fitness api to do so. I have enabled fitness api in my developer console and link my app to that. When I install the app in my device, it works perfectly showing me my steps. However if I install it on another device, it does not show any steps(steps returned are 0). Do you have any suggestions on what might be the problem? The email I declared when I enabled the fitness api in my developer console is the same

Extracting aggregate data and other data from the google-fit REST API

无人久伴 提交于 2019-12-12 02:45:49
问题 I know this has been asked similarly in two other threads, but even with both of those I still have not been able to get a simple step-count. I've been going through the documentation and have been sending requests through OAuth 2.0 Playground but I can't for the life of me get any meaningful numbers in a response, or I fear I'm overlooking something or looking in the wrong place. What I've tried: 1) Got all data sources at this request URL: https://www.googleapis.com/fitness/v1/users/{userId

Google FIT api returns different step counts

我怕爱的太早我们不能终老 提交于 2019-12-12 02:17:35
问题 Stepcount is different when accessed by getDailyTotal and getData bucketed by day. Please help. Fitness.HistoryApi.readDailyTotal(App.gClient, DataType.TYPE_STEP_COUNT_DELTA) -> returns step count as 1515 private void getStepsDataHistory(long startTime, long endTime) { DataReadRequest dataReadRequest = new DataReadRequest.Builder() .bucketByTime(1, TimeUnit.DAYS) .aggregate(DataType.TYPE_STEP_COUNT_DELTA, DataType.AGGREGATE_STEP_COUNT_DELTA) .setTimeRange(startTime, endTime, TimeUnit

java.lang.IllegalStateException: Must specify a valid bucketing strategy while requesting aggregation

ぐ巨炮叔叔 提交于 2019-12-12 01:43:44
问题 I get this error while I am creating a read request object DataReadRequest class. I tried to look for the documentation but it is unclear. Here is my code: DataReadRequest readRequest = new DataReadRequest.Builder() .read(DataType.TYPE_LOCATION_SAMPLE) .setTimeRange(startTime, endTime, TimeUnit.MILLISECONDS) .bucketByTime(1, TimeUnit.HOURS) .build(); The error is in bucketByTime method and I don't know how to proceed. 回答1: I had this error before. The short answer is to remove the line

Insert data into google fit failing: UNKNOWN_AUTH_ERROR/NEEDS_OAUTH_PERMISSIONS

白昼怎懂夜的黑 提交于 2019-12-12 01:42:43
问题 I have the following code for inserting hydration data using History Api, public void addHydrationData(int waterVolume){ Calendar cal = Calendar.getInstance(); long endTime = cal.getTimeInMillis(); cal.add(Calendar.MINUTE, -1); long startTime = cal.getTimeInMillis(); float volume = (float)waterVolume/1000f; S.L("V F: " + volume + "wv: " + waterVolume); final DataSet hydrationDataSet = createDataForRequest(DataType.TYPE_HYDRATION, DataSource.TYPE_RAW, volume, startTime, endTime, TimeUnit

Google Fit O Auth fails with RESULT_CANCELED without showing permission page

我的未来我决定 提交于 2019-12-11 13:54:52
问题 Hi I have a android project where it reads certain data from application user's Google Fit profile. I faced a weird scenario as below. all the below are in debug mode and not in release mode. 1) when compiled from my own laptop oAuth successfully worked on my phone and workflow is working fine. 2) when same code is compiled from another developer's machine, after selecting the account to be used, it does not show the permission page where we need to grant permission to google fit and the

Google Fit dataRead returns status TIMEOUT

怎甘沉沦 提交于 2019-12-11 11:31:33
问题 I am trying to get step data from Google Fit Api. I am able to successfully connect to the Api, however when I try to retrieve data using the Fitness.HistoryApi.readData() function, it always returns status TIMEOUT and no data. Anyone have any idea what I am doing wrong? Thanks! Code below private void requestHistory() { Calendar calendar = Calendar.getInstance(); calendar.set(Calendar.HOUR_OF_DAY, 0); calendar.set(Calendar.MINUTE, 0); calendar.set(Calendar.SECOND, 0); long start = calendar

DataSource.getAppPackageName() always returns “com.google.android.gms” in Google Fit

断了今生、忘了曾经 提交于 2019-12-11 09:59:28
问题 My app is reading weight data from Google Fit. The data were inserted by Withings and by my own app. But this doesn't make any difference when I call dataSet.getDataSource().getAppPackageName() , because it always returns com.google.android.gms . So I have no chance of knowing where the data came from. Google describes how to get information of the data source in this article: https://developers.google.com/fit/android/data-attribution Unfortunately this is completely useless to me. I'm using