2016-11-29 46 views
0

考慮下面的代碼的Android谷歌合式Sensor.TYPE_STEP_COUNTER相當於Xamarin

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不起作用。

回答

0

了一下後,我發現了這件事:

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

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

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