Is it possible to get PPG(Photoplethysmogram) data from a smart watch via android?

后端 未结 3 1617
醉话见心
醉话见心 2021-01-03 01:41

I want to develop a health care app using Android smart watch devices that have an optical heart rate sensor. Examples of such devices are: Samsung gear live, Moto360, LG G

3条回答
  •  情书的邮戳
    2021-01-03 01:48

    Yes, It is possible to do that. I have answered a similar question here :Android Wear: How to get raw PPG data?

    Basically, try to follow these steps:

    1- Get the sensor type (represented by a number) of your PPG sensor (it is a constant that describes the sensor). This can be done by listing all the available sensors on your device:

    List sensorList = mSensorManager.getSensorList(Sensor.TYPE_ALL);
            for (Sensor currentSensor : sensorList) {
                Log.d("List sensors", "Name: "+currentSensor.getName() + " /Type_String: " +currentSensor.getStringType()+ " /Type_number: "+currentSensor.getType());
            }
    

    2- Then, try to find the sensorType of your PPG sensor. In your output, you will find one of the sensors containing the word ppg in it's type. For instance here is what the ppg sensor of my Huawei watch 2 looks like:

    Name: AFE4405 light Sensor /Type_String:  com.huawei.watch.ppg /Type_Number: 65537
    

    3-Register your listener using the the type_number of your ppg sensor, mine is 65537 so I would do this:

    sensorManager.registerListener(this,sensorManager.getDefaultSensor(65537),SensorManager.SENSOR_DELAY_NORMAL);
    

提交回复
热议问题