0

I'm trying to access the heart sensor of LGW150 Android Wear device from Android device.

For them I am using Google Fit:

https://developers.google.com/fit/android/

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.

 for (DataSource dataSource : dataSourcesResult.getDataSources()) {
                    Log.i(TAG, "Data source found: " + dataSource.toString());
                    Log.i(TAG, "Data Source type: " + dataSource.getDataType().getName());

Full demo code:

https://developers.google.com/fit/android/sensors

I only get data of step counter of android device and step counter of android wear device

Android device:

DataSource{derived:Application{com.google.android.gms::null}:Device{samsung:SM-J510FN:46114734::1:2}:live_step_deltas:DataType{com.google.step_count.delta[steps(i)]}} Type: com.google.step_count.delta

Android wear device:

DataSource{raw:Generic ANT+ Sensor:Application{com.dsi.ant.plugins.antplus::null}:AntPlus.0.124:DataType{com.google.step_count.delta[steps(i)]}} Type: com.google.step_count.delta

Why am I not getting the data from the heart rate sensor if the device has this sensor?

martin clayton
  • 76,436
  • 32
  • 213
  • 198
user2983041
  • 1,761
  • 4
  • 19
  • 31
  • I'm unable to tell clearly since you only provided a small portion of the code, but in the [demo code](https://developers.google.com/fit/android/sensors) you linked, the only [`DataType`](https://developers.google.com/android/reference/com/google/android/gms/fitness/data/DataType.html) set was `TYPE_LOCATION_SAMPLE` (which is for . Have you tried adding `TYPE_HEART_RATE_BPM` as well? – AL. Jun 12 '17 at 06:22

1 Answers1

0

As @AL. said, DataType was wrong.

user2983041
  • 1,761
  • 4
  • 19
  • 31