/** This is called every INTERVAL_MS ms from the TimerTask. */ protected synchronized void updateData() { // Get current time for time stamps long now_ms = System.currentTimeMillis(); st.onTimerElapsed(now_ms, detector.getLastAcc(), new double[] {lastComp}); // Check if a step is detected upon data if (detector.checkForStep()) { // Call algorithm for navigation/updating position st.onStepDetected(now_ms, lastComp); } }