google-fit

Read the height in GoogleFit in Android

萝らか妹 提交于 2019-12-06 05:22:13
问题 I tried to read user's height in Google Fit in android with this code : DataReadRequest readHeightRequest = new DataReadRequest.Builder() .read(DataType.TYPE_HEIGHT) .setTimeRange(FIRST_DAY_OF_MONTH_INMS, NOW_INMS, TimeUnit.MILLISECONDS) .build(); But I only got a empty dataset with no dataPoint. According to the DataType TYPE_HEIGHT documentation: the start time should not be set. So I tried to remove : .setTimeRange(FIRST_DAY_OF_MONTH_INMS, NOW_INMS, TimeUnit.MILLISECONDS) -> CRASH java

syncing accelerometer data of android wear to phone or computer

孤者浪人 提交于 2019-12-06 03:57:53
Is it possible to sync real time data generated by sensors such as accelerometer, gyroscope etc. which are fitted on the smart watch (running on android wear) to any phone instantly. Is yes, how to do so ? Yes it is possible. Use the SensorsApi to collect the data. Use the MessageApi to send the data from the watch to the phone. 来源: https://stackoverflow.com/questions/28189733/syncing-accelerometer-data-of-android-wear-to-phone-or-computer

Is there Google Fit REST API for reading Blood Pressure data?

試著忘記壹切 提交于 2019-12-06 03:33:47
Google documentation mentions about specifically writing Blood Pressure data: https://developers.google.com/fit/scenarios/write-bp-data But it does not mention URL to be used for REST API to read Blood Pressure data? Is that Health data (Blood Pressure, Blood Glucose...) is not accessible via REST API and it is only limited to Fitness data (Calories, Steps, Distance...) I was hopeful that REST API would be available for reading Blood Pressure so that I can try it out in OAuth Playground on how it works. 来源: https://stackoverflow.com/questions/46066595/is-there-google-fit-rest-api-for-reading

How to remove a permission added because of Google Fitness API 7.5.0

百般思念 提交于 2019-12-06 02:47:56
问题 After updating my play-services-fitness api from 7.0.0 to 7.5.0 I noticed that when I go to upload a new build to the PlayStore it tells me that I am adding a new permission and 2 new features. I did not do this! What the heck. 回答1: After doing some research to pin down the culprit it was in fact play-services-fitness:7.5.0 that was to blame. By including that in your project ( compile 'com.google.android.gms:play-services-fitness:7.5.0' ) and compiling it will inject the <uses-permission

Android + Google Fit Data Upload : error 5002 - DataType's name does not match package name

扶醉桌前 提交于 2019-12-06 01:43:42
In an app we upload user activity data to Google Fit like this : Fitness.getSessionsClient(context, GoogleSignIn.getLastSignedInAccount(context)) .insertSession(((SessionInsertRequest) object)) .addOnSuccessListener(new OnSuccessListener<Void>() { @Override public void onSuccess(Void aVoid) { // At this point, the session has been inserted and can be read. if (BuildConfig.DEBUG) { Log.i(TAG, "Session insert was successful!"); } //more success handling } }) .addOnFailureListener(new OnFailureListener() { @Override public void onFailure(@NonNull Exception e) { if (BuildConfig.DEBUG) { Log.w(TAG,

Add/Read weight and height in GoogleFit? Android

有些话、适合烂在心里 提交于 2019-12-06 01:42:49
问题 By Google, I got this code to insert DataType.TYPE_STEP_COUNT_DELTA . but how to insert TYPE_HEIGHT AND TYPE_WEIGHT using Android com.google.android.gms.common.api.Status insertStatus = Fitness.HistoryApi.insertData(mClient, dataSet) .await(1, TimeUnit.MINUTES); 回答1: To insert data, you need to create a new DataSet object for both height and weight. I have created a method in order to get a DataSet object with the necessary parameters for a request. /** * This method creates a dataset object

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

我只是一个虾纸丫 提交于 2019-12-05 18:35:37
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.TYPE_LOCATION_SAMPLE, FitnessOptions.ACCESS_WRITE)); I then look for the DataSources in this way:

Using Google Fit APIs without Google Fit app

牧云@^-^@ 提交于 2019-12-05 18:20:08
问题 Can the Google Fit APIs be used without having the Google Fit APP? I want to use the Google Fit APIs to count number of steps but can this be done without having to install the Google Fit App. 回答1: Yes obviously you can use it without application installed . Let me tell you this way .. If you want to that google fit will record step count for your app then you only have to subscribe the Step datatype by using RecordingApi of google fit . Use HistoryApi to fetch the data from google fit as you

Not cheatable Google fit step counter

前提是你 提交于 2019-12-05 04:01:56
问题 i have a question to Google Fit. I am creating a step counter (oh wonder g ). This i have already done so far and it not really hard. But now we come to my problem. I am only reading the steps with the Sensor API. The issue is, i can add new data via for example the Google Fit app and it will be counted in my app too. This introduces cheating and i do not want this. So i need to have a way to only read "device created" data and not manually added data. Is there a nice way to to this? From the

Google Fitness API returns only {} as result

浪子不回头ぞ 提交于 2019-12-04 20:24:34
Here am not getting any error, but I didnt get any result from the Google fit. Am trying to getting Google Fit values for third user(example1@gmail.com). User(AuthUser@gmail.com) profile are getting properly and access token valid. But while trying to get the third party user (example1@gmail.com) and Auth user (AuthUser@gmail.com) information it show only {} as result. Any one can help me to get the fitness values from Google Fit. //oauth2Client.js getAccessToken(oauth2Client, function() { // retrieve user profile plus.people.get({ userId: 'me', auth: oauth2Client }, function(err, profile) {