9

I'm trying to access the heart rate monitor of a Samsung Gear Live watch. The watch is paired with a 4.4.4 handset and works correctly. I'm following the official BasicSensorsApi sample.

I can successfully connect to Google Play Services with the following scope:

addScope(new Scope(Scopes.FITNESS_LOCATION_READ_WRITE))
            .addScope(new Scope(Scopes.FITNESS_ACTIVITY_READ_WRITE))
            .addScope(new Scope(Scopes.FITNESS_BODY_READ_WRITE))

But then, when I want to list all available heart rate monitors, I receive an empty list of DataSource:

private void findFitnessDataSources() {
    Fitness.SensorsApi.findDataSources(mGoogleApiClient, new DataSourcesRequest.Builder()
            .setDataTypes(
                    DataType.TYPE_HEART_RATE_BPM)// At least one datatype must be specified.
            .setDataSourceTypes(
                    DataSource.TYPE_RAW)// Specify whether data type is raw or derived.
            .build())
            .setResultCallback(new ResultCallback<DataSourcesResult>() {
                @Override
                public void onResult(DataSourcesResult dataSourcesResult) {
                    for (DataSource dataSource : dataSourcesResult.getDataSources()) {
                        if (dataSource.getDataType().equals(DataType.TYPE_HEART_RATE_BPM)
                                && mListener == null) {
                            registerFitnessDataListener(dataSource,
                                    DataType.TYPE_HEART_RATE_BPM);
                        }
                    }
                }
            });

If I change the DataType to, for example, TYPE_STEP_COUNT_CUMULATIVE or TYPE_LOCATION_SAMPLE, the list will contain my phone, which seems logical.

Why is the watch not listed as an available DataSource then?

Please note: This is not a duplicate of:

  1. Get Heart Rate from “Sensor” Samsung Gear Live
  2. How to access heart rate sensor in Android Wearable?

because I want to access the heart beat data through the recently released Google Fit API.

I don't think enabling debug mode on the watch is necessary, but I've tried that. Also, I don't think adding BODY_SENSORS permission is necessary, because the whole process is managed by Google Fit API anyway, but I've tried that too with no luck.

Community
  • 1
  • 1
EyesClear
  • 26,173
  • 7
  • 28
  • 41
  • Hi, please, can you help me with this problem, I also have the same smartwatch but it's not visible from the app http://stackoverflow.com/questions/31022431/android-how-to-get-google-fit-data-from-wearable-device – user3290180 Jun 25 '15 at 10:31
  • it doesn't work even if I search for all DataTypes. The devices are paired. – user3290180 Jun 25 '15 at 10:40
  • Hi, there are software sensors which might get it to work, see the links at http://stackoverflow.com/a/31231411/1587329 (the question in the comments above) – serv-inc Jul 05 '15 at 14:40

1 Answers1

6

The Samsung Gear Live watch does not advertise itself as a BLE heart rate monitor and therefore does not make the heart rate data available via the normal Bluetooth Low Energy API or the Google Fit API which is built upon it.

ianhanniballake
  • 155,909
  • 19
  • 351
  • 362
  • This is truly disappointing. I've just wasted over $250 on this device. Thank you, Ian. – EyesClear Nov 09 '14 at 00:10
  • 1
    None of the heart rate sensors found in Android Wear devices (of today!) are truly continuous sensors such as those found on traditional heart rate monitor chest straps - those are still the best bet if you are specifically looking for accurate, near real time heart rate data. – ianhanniballake Nov 09 '14 at 00:14
  • @ianhanniballake: How about using software sensors? Should these work? – serv-inc Jul 05 '15 at 14:41
  • 1
    @user1587329 - do you mean writing your app that that uses the Samsung Gear Live SDK to pull information onto the phone, then registering as a software sensor with Google Fit such that you can feed that data to Google Fit? Sure, assuming the Gear SDK gives you that level of data, I don't see why that wouldn't work. – ianhanniballake Jul 05 '15 at 18:35
  • Pretty much, except for using the standard android.sensors and `android.support.wearable.view.WatchViewStub` APIs. See the ideas at http://stackoverflow.com/a/31231411/1587329 and concerning the watch, at http://stackoverflow.com/questions/24664217/get-heart-rate-from-sensor-samsung-gear-live – serv-inc Jul 06 '15 at 07:31