// 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 on the current android mobile device bool hasStepDetector = utilsPlugin.HasStepDetector(); bool hasStepCounter = utilsPlugin.HasStepCounter(); //if (hasStepDetector) { if (hasStepCounter) { // yehey your android mobile device support pedometer UpdateStepDetectorStatus("available"); // event listeners AddEventListeners(); //initialze pedometer pedometerPlugin.Init(); } else { // if you get this meaning // pedometer is not available on your android mobile device sorry! 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); utilsPlugin = UtilsPlugin.GetInstance(); utilsPlugin.SetDebug(0); //check if step detector is supported bool hasStepDetector = utilsPlugin.HasStepDetector(); bool hasStepCounter = utilsPlugin.HasStepCounter(); //if (hasStepDetector) { if (hasStepCounter) { UpdateStepDetectorStatus("available"); // event listeners AddEventListeners(); //initialze pedometer pedometerPlugin.Init(); } else { UpdateStepDetectorStatus("not available"); } }