Tuesday, July 22, 2014

First Android Application: HeartChart

A few years ago, I experienced a dramatic episode of Takotsubo cardiomyopothy after which I have periodic episodes of atrial fibrillation or “AFib”.  At this point, I have suffered from AFib for so long that I have learned to ignore minor episodes.  However, If they become more severe, I can respond by taking medicine to reverse the symptoms.  The RR interval allows me to view empirically more dramatic changes in my heart rate than just a simple heart rate reading alone.

Here’s an explanation of RR from here“The RR interval is the time between QRS complexes.  The instantaneous heart rate can be calculated from the time between any two QRS complexes.  The drawback of this method is that the calculated heart rate can be quite a bit different from the measured pulse even in a normal person due to variations in the heart rate associated with respiration (the sinus arrhythmia)…”

Here’s a simple description from the folks at Polar who make an RR compatible monitor.
Unfortunately, Bluetooth Low Energy or Bluetooth Smart is a newer technology on the Android platform and so there are not a great deal of applications out there that support these great devices; and very few that support viewing the RR interval.  Time to ramp up on Android development and learn a new skill so I can build what I need to get the data I want.

First the requirements:  I carry the Samsung Galaxy S3 and S4 (waiting for the Note 4) and wanted the app to run on those.  I have bought a couple of chest straps, the high-end Zephyr and the budget priced JARV (which is my favorite at about half the price).  Therefore, I wanted the app to run on those and wanted them to display the RR as well as heart rate.  Both work great with my little application.

I also wanted to get an idea of the average values over time as well as the standard deviation (variation from the average over the time period) and display those.  The following is a screenshot showing the result:
image
The freeware application is available from both the Amazon Android App Store and Google Play as “HeartChart”.

One final point of interest: I called the application Heart Chart because an earlier version did chart the heart rate over long period of times – such as overnight.  I was interested to see if I was having episodes of AFib while sleeping and the results were indeed interesting.  However, I removed that for the public release out of concern that folks might use this as a diagnostic tool for something like sleep apnea when this is not a medical application and should not be used as such!