Having trouble reading heart rate sensor from Moto 360 - Android Wear

后端 未结 6 893
悲&欢浪女
悲&欢浪女 2021-01-01 01:47

Has anyone successfully read the heart rate sensor from the Moto 360?

mSensorManager = ((SensorManager)getSystemService(SENSOR_SERVICE));
mHeartRateSensor =          


        
6条回答
  •  轮回少年
    2021-01-01 02:47

    I had same issue with Moto360 and hers how I solved it.

    I tried all the solutions listed - re installing the app, upgrading the SDK but it dint work for me. I included permissions for body sensors in Manifest file. I couldn't see heart rate sensor in my list of available sensors. So I believe it was a permissions issue. API 23 onwards android uses a new permissions model.

    From this link : https://developer.android.com/training/articles/wear-permissions.html It says - "Note: For an app to use the new permissions model, it must specify a value of 23 for both uses-sdk-element and compileSdkVersion."

    I changed my gradel scripts to use both minsdk and compliledsdk as 23. Also added following to my app manifiest.

     
    

    And Now its working !!

提交回复
热议问题