// Use this for initialization void Start() { //get the instance of pedometer plugin pedometerPlugin = PedometerPlugin.GetInstance(); //set to zero to hide debug toast messages pedometerPlugin.SetDebug(0); utilsPlugin = UtilsPlugin.GetInstance(); utilsPlugin.SetDebug(0); //check if step detector is supported bool hasStepDetector = utilsPlugin.HasStepDetector(); if (hasStepDetector) { UpdateStepDetectorStatus("available"); //initialze pedometer pedometerPlugin.Init(); //set this to true to always starts at zero steps, else set to false to continue steps pedometerPlugin.SetAlwaysStartAtZero(true); //set call back listener for pedometer events pedometerPlugin.SetCallbackListener(OnStepCount, OnStepDetect); //register sensor event listener and pass sensor delay that you want pedometerPlugin.RegisterSensorListener(SensorDelay.SENSOR_DELAY_FASTEST); } else { UpdateStepDetectorStatus("not available"); } }
// Use this for initialization void Start() { //get the instance of pedometer plugin pedometerPlugin = PedometerPlugin.GetInstance(); //set to zero to hide debug toast messages pedometerPlugin.SetDebug(0); //initialze pedometer pedometerPlugin.Init(); //set this to true to always starts at zero steps, else set to false to continue steps pedometerPlugin.SetAlwaysStartAtZero(true); //set call back listener for pedometer events pedometerPlugin.SetCallbackListener(OnStepCount, OnStepDetect); //register sensor event listener pedometerPlugin.RegisterSensorListener(); }
// Use this for initialization void Start() { //get the instance of pedometer plugin pedometerPlugin = PedometerPlugin.GetInstance(); //set to zero to hide debug toast messages pedometerPlugin.SetDebug(0); //initialze pedometer pedometerPlugin.Init(); //set this to true to always starts at zero steps, else set to false to continue steps pedometerPlugin.SetAlwaysStartAtZero(true); //set call back listener for pedometer events pedometerPlugin.SetCallbackListener(OnStepCount,OnStepDetect); //register sensor event listener pedometerPlugin.RegisterSensorListener(); }