google-fit

How do I get the readings of various fitness activities using Google Fit API?

家住魔仙堡 提交于 2019-12-11 08:54:37
问题 There are various fitness activities in Google Fit API such as Aerobics, Badminton, Boxing, Weight Lifting, etc. How do I get the readings of the steps counted and the calories burnt for each of these activities using Google Fit API? Any sort of suggestions are most welcome. Thanks in advance. 回答1: I'm not sure if this result is what you need. You can use bucketByActivitySegement under DataReadRequest.Builder to split each activity segement. DataReadRequest readRequest = new DataReadRequest

Google Fit : Cannot update both step and distance in real-time

一个人想着一个人 提交于 2019-12-11 04:58:18
问题 I can use sensor api to get step data in real time. I also can get distance data in real time too. However, I can't get step and distance together. This is my code. private void registerFitnessDataListener(final DataSource dataSource, final DataType dataType) { if (mListener == null) mListener = new OnDataPointListener() { @Override public void onDataPoint(DataPoint dataPoint) { isUpdatingStep = false; if (!isUpdatingStep) { for (Field field : dataPoint.getDataType().getFields()) { if (String

How to retrieve daily running and walking steps from Google Fit API

*爱你&永不变心* 提交于 2019-12-11 02:43:56
问题 It is probably a newbie question but I have lost a one day to figure out w/o success. I'm using Google Fit API into my Android app and I need to show some of its data like running and walking daily steps. I have managed to show data but in time unit (f.e running in x min). I need to show it in steps unit. The snipped below code shows how I retrieved data as time unit (in milliseconds): DataReadRequest readRequest = new DataReadRequest.Builder() .aggregate(DataType.TYPE_ACTIVITY_SEGMENT,

How do I get the steps from Google Fit API?

非 Y 不嫁゛ 提交于 2019-12-11 01:27:08
问题 Pardon noobiness, I am completely new to Android, and Google APIs. I have the following code that connects to GoogleFit. I also have an API key and Oauth. Where/how do i use API key and Oauth? Lots of guides on how to obtain them but zero info on where to put them/how to use them in the app. And how do I actually use the steps returned. I set up a global: private int steps; and then try to set it via: steps = (int)total; but it does nothing. Here is the rest of the function. How do I actually

Submit weight information / distance through the Google Fit REST API

Deadly 提交于 2019-12-10 23:13:45
问题 I've been building a fairly simple app for a few weeks now, that pushes activity from my Fitbit Flex tracker to Google Fit. It's all very simple: it has created data sources, and uses those to push the last hour's calorie count, step count and distance to Google Fit. It also pushes my weight, should I log it using the Fitbit app. Every hour, it pushes these three metrics in three different data sets, each with a single data point. For example: from 10:00 to 10:59, 451 steps. This works pretty

Android Fitness API not reading data from wearable sensors

大憨熊 提交于 2019-12-10 18:26:01
问题 I have been reading about Google Fit API, specially the Sensors API (https://developers.google.com/fit/android/sensors), which says : The Sensors API provides access to raw sensor data streams from sensors available on the Android device and from sensors available in companion devices, such as wearables. Also, watching Google's example video, they says "They could be sensors available on the Android Device or sensors available on companion devices. For example, for steps, Fit will use the

Read BloodPressure and BloodGlucose dataSource from google api fitness playground

纵然是瞬间 提交于 2019-12-10 12:54:56
问题 If I go to google api playground I do the following steps: Step 1: Select & authorize APIs. I select the two scopes https://www.googleapis.com/auth/fitness.blood_glucose.read https://www.googleapis.com/auth/fitness.blood_pressure.read cause I need to read blood glucose and pressure from user. I select a google user and authorize the application to read the data. Step 2: Exchange authorization code for tokens. I exchange the authorization token for the access and refresh token. Step 3:

How to get Heart Rate values from Google Fit History?

左心房为你撑大大i 提交于 2019-12-10 11:37:53
问题 I need to get all the heart rate measurements, and not the minimum, maximum and average, which is what I have been able to get. This is the code I use for reading from my java class. Thank you! private void readDataFitnessHistory() { // Setting a start and end date using a range of 1 week before this moment. Calendar cal = Calendar.getInstance(); Date now = new Date(); cal.setTime(now); long endTime = cal.getTimeInMillis(); cal.add(Calendar.WEEK_OF_YEAR, -1); long startTime = cal

syncing accelerometer data of android wear to phone or computer

[亡魂溺海] 提交于 2019-12-10 09:55:50
问题 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 ? 回答1: 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

Create Doughnut Chart Similar to Google Fit

≡放荡痞女 提交于 2019-12-09 16:26:46
问题 Does anyone know how to create a doughnut chart similar to the one in Google Fit. Is there a library for this? 回答1: I also wanted this, but the best answer i could find was "make your own". So I did. This is pretty basic (I'm new to android) and unfinished, but it should give you the idea. Basically, you just set up your paint objects paintPrimary = new Paint(); paintPrimary.setAntiAlias(true); paintPrimary.setColor(colorPrimary); paintPrimary.setStyle(Paint.Style.STROKE); paintPrimary