Google-适合 Xamarin 中的 Sensor.TYPE_STEP_COUNTER

Google-Fit Sensor.TYPE_STEP_COUNTER equivalent in Xamarin

给定以下代码 Android

private SensorManager mSensorManager = (SensorManager)        
        getSystemService(Context.SENSOR_SERVICE);
private Sensor     mStepCounterSensor = mSensorManager
        .getDefaultSensor(Sensor.TYPE_STEP_COUNTER);
private Sensor       mStepDetectorSensor = mSensorManager
        .getDefaultSensor(Sensor.TYPE_STEP_DETECTOR);

我无法找出相关的 Xamarin.Android 代码。 特别是我找不到 Sensor.TYPE_STEP_COUNTERSensor.TYPE_STEP_DETECTOR.

的等价物

尝试使用 Sensor.StringTypeStepCounterSensor.StringTypeStepDetector 无效。

过了一会儿我发现了:

private SensorManager mSensorManager = (SensorManager) GetSystemService(Context.SensorService);

private Sensor mStepCounterSensor = mSensorManager.GetDefaultSensor(SensorType.StepCounter);

private Sensor mStepDetectorSensor = mSensorManager.GetDefaultSensor(SensorType.StepDetector);