google-fit

Google fit API, onDatapoint method is not being invoked

时光总嘲笑我的痴心妄想 提交于 2019-12-31 07:46:05
问题 I am not able to get step count. I've been stuck on getting the onDataPoint method to be called. This code is almost correct. I am not able to find why it is not showing step count. package com.example.akkisocc.heath; import android.content.Intent; import android.content.IntentSender; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.util.Log; import android.widget.TextView; import android.widget.Toast; import com.google.android.gms.common

Getting active time from Google Fit Rest API

爷,独闯天下 提交于 2019-12-31 01:26:12
问题 I am struggling with matching the "active time" returned by Fit REST API with reality. As an example - on 12/14 I had two walks, about 45 minutes each. The api returns one of them as type 7 ("walking" - right!) and another one as type 0 (in vehicle - wrong!). However, Fit app shows both as "walking", so it apparently uses a different data source. I checked some other days and on these days, the session with type 0 is indeed a valid "in vehicle" session. I tried all aggregated data sources

Android: Google Fit not finding data sources for DataType.TYPE_LOCATION_SAMPLE

邮差的信 提交于 2019-12-30 10:36:53
问题 I have some code that has worked for months in production which suddenly has stopped working yesterday in all my apps. I use Google Fit to retrieve locations via the Fitness.SensorClient API. Locations permissions are requested correctly to the user at installation time (both the generic Android FINE_LOCATION permission and the permission to read and store locations into Google Fit). I create the Fitness Option in this way: setFitnessOptions( FitnessOptions.builder() .addDataType(DataType

Android: How to get Google Fit data from Wearable device?

无人久伴 提交于 2019-12-29 05:51:45
问题 I'm following the same steps described here (the Google Fit client connection part is working fine). final DataType dataType=TYPE_STEP_COUNT_DELTA; DataSourcesRequest requestData = new DataSourcesRequest.Builder() .setDataTypes(dataType) // At least one datatype must be specified. .build(); Fitness.SensorsApi.findDataSources(mClient, requestData) .setResultCallback(new ResultCallback<DataSourcesResult>() { @Override public void onResult(DataSourcesResult dataSourcesResult) { Log.i(TAG,

Unable to find BLE device when type is STEP_COUNT_DELTA

♀尐吖头ヾ 提交于 2019-12-25 01:44:52
问题 I am using the Google fit API to connect with a Sony Smartband2 band. All I am trying to do right now, is scan and claim a device. (Following This Fitness ble guide ) I can find and claim my device, when I set the data type as TYPE_HEART_RATE_BPM. However, when I set it to TYPE_STEP_COUNT_DELTA or TYPE_STEP_COUNT_CUMULATIVE, I am unable to find the device. What maybe the issue? I know that later I will also need to use the Sensors API, but to find the device, I do not need it, right? To build

Google fit API OAUTH Issue

不问归期 提交于 2019-12-25 01:39:59
问题 I'm trying to build a step counter application, as a test i downloaded the android fit code from github and ran the basicsensorsAPI: googlesamples/android-fit In order to get stepcount instead of location I changed the data type to TYPE_STEP_COUNT_CUMULATIVE and TYPE_DERIVED , (the orignials are TYPE_LOCATION_SAMPLE and TYPE_RAW ). But as soon as I do this the OAUTH stops working, and i'm not sure why this is creating an issue. Here is the changed code: private void findFitnessDataSources() {

Google Fit Android plug-in for Unity3D

可紊 提交于 2019-12-24 18:41:10
问题 I am relatively new to Android development and Unity and I am trying to create an Android plug-in for Unity3D that detects steps and distance using the Google fit Sensors API. I have already exported my plugin as a jar file, imported in on Assets/Plugin/Android together with my AndroidManifest.xml and when I try to build and run on my phone I get this error: java.lang.ClassNotFoundException: Didn't find class "com.google.android.gms.fitness.request.OnDataPointListener" on path: DexPathList[

Custom DataTypes not synching between devices

孤者浪人 提交于 2019-12-24 02:43:35
问题 I am trying to use the Google Fit API to store custom dataTypes . I am able insert, and retrieve them fine on a single device, but when I log into the same Google account on a different device the data is not there. I can create and retrieve data from each device but they both keep their own data, and do not sync up thru the cloud. I have tried using .enableServerQueries() in my DataReadRequest builder and still nothing. 来源: https://stackoverflow.com/questions/28059665/custom-datatypes-not

Google Fit API Sleep insert and read DataPoint in Session

白昼怎懂夜的黑 提交于 2019-12-24 00:13:36
问题 I try (like in the topic described) to insert and read Sleep as an Fitness Activity. Main Goal is to analyse a whole sleep with (when was Light/deep sleep and how long) for a single Session. Connection to GoogleFit succeed. But i have trouble with Datapoint and Data Session. Maybe you can help me. Thanks guys :D A little bit of code where i think i'm trouble. I'm aware of the not clear code. i tried to copy i tried to paste. in some parts the names doesn't fit. But as i mention. i try to

Google Fit API : Get distance/calories/speed when tracking running/biking?

自作多情 提交于 2019-12-24 00:09:42
问题 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