The app has the following functionalities:
- Shows current latitude, longitude and altitude on screen
- Shows current Wifi strength and SSID
- Shows current heart rate
- Shows approximate number of steps based on Accelerometer data
The main functionality of the app is defined in main/wear/src/main/java/CSE218/MainActivity.java
The heart rate listener is defined in main/wear/src/main/java/CSE218/HeartRateListener.java
The step count listener is defined in main/wear/src/main/java/CSE218/StepCountListener.java
The step counter algorithm was largely inspired from the MathWorks counting steps documentation. It is defined as follows:
- First the gravity component is removed from the raw accelerometer data with a low pass filter which provides some smoothing.
- Thereafter a z-scoretime series peak detection algorithm adapted from StackOverflow. In summary, the raw z score is defined as
z = (x-m)/s
where m is the mean, s is the standard deviation and x is the input. The algorithm samples a certain number of inputs and maintains a average for the minimum number of sampled inputs. The mean and standard deviation gets updated for the next window and gets repeated for the next set of inputs. The peaks detected in the process are the steps detected among the inputs sampled.