This section is dedicated to the implementation of the type of step detection algorithm discussed in the previous section. Our implementation for the algorithm will consist of four major components of android: first is android service, which will stay in the background, second is a set of two threads using the ScheduledExecutorService
, and third is the activity to show the pedometer application data. The last component is the SQLite database to store the steps' information. The following is the high-level class diagram of the application; we will discuss each class in detail in their own sections. Now, let's explore the first component in detail:
The first component of the algorithm is the
StepsTrackerService
service, which will remain in the background and provide a container for execution. Inside this service, we create theStepDetectorListener
andAccelerometerListener
classes and...