計步器算法, android , ios