Saturday, October 10, 2020

App HealthMate on Android Part 2 - Activities

Okay, second part of my analysis.

The first part can be found at: https://bebinary4n6.blogspot.com/2020/10/app-healthmate-on-android-part-1-users.html

Base folder of the app: /data/data/com.withings.wiscale2 

This post is about the activity data tracked by the app HealthMate. There will be a third part of my analysis where I will show what is tracked in detail about GPS and heart rate.

First of all, in the first part I only showed data extracted from the database Withings-WiScale in the folder databases. For this post I will also show data from the database room-healthmate.db in the same directory.

 

Activities - Overview

Activities can be e.g. Walking, Running, Cycling, Sleeping. Okay, Sleeping is a special case, but it is logged in the same location.
 
First the overview. What activities have been logged and the summary of them.

There are different overviews available.
 

1. Timeline

The timeline stores the information showed to the user in the app. It stores the user id, the type, the expiration date (and the resulting ttl) and the data itself in JSON-Format.

It is stored in the table timeline of the database Withings-WiScale.


 
 
You get different types of information out here. For example the aggregation of steps over the day or the heart rate aggregated for 24 hours.
Also you can see information about a new installed tracker or a new message. The entries will persist in the table after ttl. But I have not tested for how long in total they are stored.

Example content of the field data, here for the entry with id 5:


 2. Tracking

The second source for an overview is the table Track in the database room-healthmate.db.
It stores the data of every tracked activity. This can be manual triggered activities or automatic detected ones.
 
The following figure shows a few columns. The table has a lot more I will show a bit later.


Again a userId is stored so the activity can be linked to an account. We also have a startDate and endDate in Unix epoch UTC. The field dataJson holds the data of the activity. We will take a look at it in a second.
But I want to highlight two more fields:

 1. category - The number in this field give info what type of activity is tracked. 
              2 = Running
              1 = Walking
              6 = Cycling
        You can find these values in the table activityCategory, database Withings-WiScale

But two values I could not find there. Fortunately it is not so difficult to find out what they mean
                37 = Sleeping
              272 = Activity started on watch, together with an acitivity wiht the exact same startDate and                             endDate one knows that this activity was manually tracked

2. activityRecognitionVersion
This field has a value if the activity was automatically tracked. Except for "sleeping", this is always automatically tracked but the value is NULL.

Sleeping

Okay, let us take a look into the data for a sleeping activity. The one with id 5.
First the content of the field dataJson:
 
 
Than the fields startDate and endDate:
I formatted the content to a DateString, UTC.
 
As you can see it was a good night for me, about 7 hours and 46 mins of sleep.
My heart rate was at 72 in average. A bit high for me but okay.

I double checked the data, it seems to be correct.

There are other additional fields for sleeping in the database. But the most important data I have shown here.

Running/Walking/Cycling

What about the other activities? I will only show one, from the data structure they a similar.
I will show the one with id 2, the running activity.

First the content of the field dataJson:
 
 Than the fields startDate and endDate:
 
 
Okay, the data is from a run on 4th October. The deviceStartDate and deviceEndDate from the JSON is directly stored in the database fields startDate and endDate.
I did 5429 steps - 6479 km (estimated on the average length of a step), I did 136 seconds break (pauseDuration) because of red traffic lights. 643 seconds I was in peak zone, 1475 seconds in intense zone and 32 seconds in moderate zone. My maximum heart rate was 187, minimum 130 and average 164. 
This data is tracked if one manually starts the activity on the watch or the watch itself recognize an activity.          

Activity connected with Smartphone

 If the watch is connected to the Smartphone when tracking there are additional fields filled in the database (here for a walking activity):

This data is filled with the help of the GPS data from the Smartphone. 

A bit problematic is the value for the speed. 2.6 kph maxSpeed? A bit too slow. I think it is mph. 2.6 mph are about 4.8 kph. Seems more realistic. But I did not double check it.

Until now we only have data about activities, when they started and end and what average or total values were generated with this activity. Time to  find the detailed information. But, this I will show in the next post. You can find it here: https://bebinary4n6.blogspot.com/2020/10/app-healthmate-on-android-part-3-heart.html



No comments:

Post a Comment