google-fit

How to differentiate between manual added steps and sensor recorded steps in Google Fit Api

ⅰ亾dé卋堺 提交于 2019-12-02 08:56:05
问题 I am using Google Fit Api in my project to get user's daily steps. But the problem is, user can enter the steps manually by adding the activities. And when i retrieve the daily steps, Google Fit Api also returns the steps which were added manually. Is there any way to differentiate between manually added steps and sensor recorded steps. 回答1: Basically, the example given in the Google Fit documentation states that you can get the base daily steps total of your device by using this method. Your

Using google fit api from a backend server

最后都变了- 提交于 2019-12-02 08:52:36
I'm writing an android application which needs to read user's fitness data (steps, calories, etc) from a back end server. this server will read the data and push notifications to android app if necessary. I managed to get the authentication part done and app is now sending the code recevied from oauth flow to the backend server (followed this example) and the server successfully exchanges the code access and refresh tokens. The problem is I did not find any resource on how to access the fitness data from a backend server in the google samples. I found the library <dependency> <groupId>com

Google Fit API : Get distance from google fit

为君一笑 提交于 2019-12-02 07:54:53
How do I calculate the distance covered by the user using the google fit API? Currently I am using google Fit History Api like this : DataReadRequest readRequest = new DataReadRequest.Builder() .aggregate(DataType.TYPE_DISTANCE_DELTA, DataType.AGGREGATE_DISTANCE_DELTA) .bucketByTime(1, TimeUnit.DAYS) .setTimeRange(startTime, endTime, TimeUnit.MILLISECONDS) .build(); DataReadResult dataReadResult = Fitness.HistoryApi.readData(mGoogleApiClient, readRequest).await(1, TimeUnit.MINUTES); But this is not returning any value Does anyone a clue? You need to add one more scope when you instantiate

GoogleFit Sample Not Working

对着背影说爱祢 提交于 2019-12-02 07:41:38
I am trying the BasicHistory Sample whis stores a data and then read it but in my case the code get stuck at the insert call.await call does not return anything i have tried using the asynchronous way also,here is the code com.google.android.gms.common.api.Status insertStatus = Fitness.HistoryApi.insert(mClient, insertRequest).await(1, TimeUnit.MINUTES); Have you requested the right permissions? According to that Google Fit sample, it only requires permission for "Activity". If you change the data type used in that sample for other different, make sure you are setting right permissions. Read

Google Fit API Activity History

自闭症网瘾萝莉.ら 提交于 2019-12-02 06:03:16
I have an app that integrates with Google Fit. One of the requirements is display a users favorite activity (most frequent) i.e.: bicycling. I assume it would be done through the History API, but I'm not sure how to gather all activities so I can calculate the most common one. Anybody have any idea how to go about doing that? abielita You can check this documentation: Work with the Fitness History to get most frequent activity of the user. First, you need to read data from the fitness history by creating a subscription for each fitness data type you'd like to record. This enables your app to

Getting active time from Google Fit Rest API

久未见 提交于 2019-12-01 18:24:36
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 that return com.google.activity.segment. Most of them are empty, I've found data only in merge_activity

Google Fit Api filter manually added activities

冷暖自知 提交于 2019-12-01 12:11:31
Google Fit allows users to add activities manually and programatically. Is it possible to filter out manually or programtically added activities from either the Android Api or the REST Api? I want to query for only activities that were actually tracked and recorded at the time they were performed. There is no proper way according to the documentation. But I found some solution to identify manual and automatic tracked activities in Android API. DataSource ds = DataPoint.getOriginalDataSource() String streamData = ds.getStreamIdentifier() If "streamData" contains "user_input", then it assumes

Fetching Google Fit Data into android application

非 Y 不嫁゛ 提交于 2019-12-01 10:26:54
How can we get the data stored in google fit cloud for a specific user? I tried using History API but no data is being displayed. Then i tried entering some data vai History api, now I could see these data only via history api not the complete data that actually resides in fit. DataReadRequest readRequest = queryFitnessData(); DataReadResult dataReadResult = Fitness.HistoryApi.readData(mClient, readRequest).await(1, TimeUnit.MINUTES); Data Request is DataReadRequest readRequest = new DataReadRequest.Builder() .aggregate(DataType.TYPE_STEP_COUNT_DELTA, DataType.AGGREGATE_STEP_COUNT_DELTA)

Android Google Fit Unable to Read Blood Pressure Value

旧时模样 提交于 2019-12-01 09:40:38
I have tried to read Blood pressure value from Google Fit using Android code but unable to read value and returns the below logs Blood Pressure Log: Number of returned buckets of DataSets is: 1 Datasets: [DataSet{d:blood_pressure.summary:gms:aggregated []}] Name: com.google.blood_pressure.summary Fields: [blood_pressure_systolic_average(f),blood_pressure_systolic_max(f), blood_pressure_systolic_min(f), blood_pressure_diastolic_average(f), blood_pressure_diastolic_max(f), blood_pressure_diastolic_min(f), body_position(i), blood_pressure_measurement_location(i)] Data Point Values : [] I have

Why Google Fit steps Counts differs

99封情书 提交于 2019-12-01 08:39:17
I used Sensor API for counting steps. I saw it's differs from Google Fit App. Does Google Fit app uses Sensor API other things? Code Snippet : Fitness.SensorsApi.add( mGoogleApiFitnessClient, new SensorRequest.Builder() .setDataType(DataType.TYPE_STEP_COUNT_DELTA) .setSamplingRate(5, TimeUnit.SECONDS) .build(), mListener) .setResultCallback(new ResultCallback<Status>() { @Override public void onResult(Status status) { if (status.isSuccess()) { Log.i(TAG, "Listener registered!"); } else { Log.i(TAG, "Listener not registered."); } } }); Steps count Result My app : 2484 Google Fit : 4636 Did I