google-fit

Android ACTIVITY_RECOGNITION Permission SDK 28 running on Android 10/Q (SDK 29)

本秂侑毒 提交于 2020-08-02 04:15:35
问题 My Android app targets SDK 28 and connects to Google Fit to upload data and read some other data. The app uses the HistoryAPI to read com.google.step_count.delta data. This documentation claims that "com.google.android.gms.permission.ACTIVITY_RECOGNITION permission is converted into a pre-granted runtime permission" if the app targets SDK 28 but runs on SDK 29: https://developers.google.com/fit/android/authorization#android_permissions I have added to the app's manifest like the documentation

Android ACTIVITY_RECOGNITION Permission SDK 28 running on Android 10/Q (SDK 29)

*爱你&永不变心* 提交于 2020-08-02 04:14:36
问题 My Android app targets SDK 28 and connects to Google Fit to upload data and read some other data. The app uses the HistoryAPI to read com.google.step_count.delta data. This documentation claims that "com.google.android.gms.permission.ACTIVITY_RECOGNITION permission is converted into a pre-granted runtime permission" if the app targets SDK 28 but runs on SDK 29: https://developers.google.com/fit/android/authorization#android_permissions I have added to the app's manifest like the documentation

Getting location data from Google Fit Api

让人想犯罪 __ 提交于 2020-06-27 17:22:35
问题 I am trying to fetch location data from Google fit activity which I have added through mobile. I am currently using OAuth2 Playground to test the request. The request URI i am using is : https://www.googleapis.com/fitness/v1/users/me/dataset:aggregate Request Body { "aggregateBy": [{ "dataTypeName": "com.google.location.sample" }, { "dataTypeName": "com.google.distance.delta" }], bucketBySession:{ minDurationMillis: 1 }, "startTimeMillis": 1522281600000, "endTimeMillis": 1522368000000 }

Getting location data from Google Fit Api

限于喜欢 提交于 2020-06-27 17:22:26
问题 I am trying to fetch location data from Google fit activity which I have added through mobile. I am currently using OAuth2 Playground to test the request. The request URI i am using is : https://www.googleapis.com/fitness/v1/users/me/dataset:aggregate Request Body { "aggregateBy": [{ "dataTypeName": "com.google.location.sample" }, { "dataTypeName": "com.google.distance.delta" }], bucketBySession:{ minDurationMillis: 1 }, "startTimeMillis": 1522281600000, "endTimeMillis": 1522368000000 }

Google Fit (Android) Get last 10 days data

大兔子大兔子 提交于 2020-04-30 07:32:23
问题 I am trying to get last 10 days data from google Fit in Android (6.0) Phone. It returns current day data correctly, but when i try to fetch data for yesterday or before that, it returns random or wrong data. // get the start and end date of the urrent mobile Calendar cal = Calendar.getInstance(); Date now = new Date(); cal.setTime(now); long endTime = cal.getTimeInMillis(); cal.add(Calendar.DAY_OF_YEAR, -10); long startTime = cal.getTimeInMillis(); java.text.DateFormat dateFormat = DateFormat

How to fix Error: Require at least one aggregateby? - fitness api

佐手、 提交于 2020-04-17 22:53:48
问题 I keep getting these error "Error: Require at least one aggregateby" and no idea how to fix it. I have tried many ways: fitness.users.dataset.aggregate({ auth: serviceAccountAuth, userId: "me", //fields: "bucket/dataset/point/value/intVal", requestBody: { "aggregateBy": [{ "dataTypeName": "com.google.step_count.delta", "dataSourceId": "derived:com.google.step_count.delta:com.google.android.gms:estimated_steps" }], "endTimeMillis": 1566733471706, "startTimeMillis": 1566647071706, "bucketByTime

Get current logged in user info (email or userid) from google fit API

偶尔善良 提交于 2020-03-26 03:58:49
问题 I am integrating google fit APIs for tracking fitness activities and I need to display logged in user email, but I am not able to fetch user info like email or userid from google fit. I have found https://developers.google.com/fit/rest/v1/reference/users/dataSources/get but I need to add userId and dataSourceId in request parameters which I am unable to find. 回答1: You are looking at the wrong place. The data you are looking for is under: People API v1 . Use the following scopes for oAuth:

Get current day's steps during datapointListener google Fit

北慕城南 提交于 2020-03-02 07:50:26
问题 Using the following code, I get the cumulative steps since I started recording the values. But I would like to show only the current day's steps instead of cumulative. @Override public void onConnected(@Nullable Bundle bundle) { DataSourcesRequest dataSourceRequest = new DataSourcesRequest.Builder() .setDataTypes(DataType.TYPE_STEP_COUNT_CUMULATIVE) .setDataSourceTypes(DataSource.TYPE_RAW) .build(); ResultCallback<DataSourcesResult> dataSourcesResultCallback = new ResultCallback