I have an Android app and I want to read the heart rate from any connected Android watch (Wear OS, Tizen, etc). Is this possible without developing a wearable app?
I tried registering a listener on the Sensor.TYPE_HEART_RATE
but I don't see any of the 3 watches that I have show up (Ticwatch E, Ticband, Gear S2). I ensured I request the Manifest.permission.BODY_SENSORS
permission.
sensorManager = getSystemService(Context.SENSOR_SERVICE) as SensorManager?
heartRateSensor = sensorManager?.getDefaultSensor(Sensor.TYPE_HEART_RATE)
val registered = sensorManager?.registerListener(this, heartRateSensor, SensorManager.SENSOR_DELAY_NORMAL)
Log.i(TAG, if (registered!!) "Registered Listener" else "Failed to register listener")