Tinkering with Android’s Health Connect data, the hub for fitness data in the Android ecosystem. I don’t want to mess with their formal APIs so I’m looking to use the nightly full database backups I have it making to Google Drive. They seem to work and contain real data. (This may be a mistake: Health Connect has some semantics implicit in their API I’m having to rediscover by looking at the raw data.)
The result is a .zip file with a single .db file in it, a sqlite3 database. That database has some 73 tables in it but many are empty. So my sexual_activity_record_table shows 0 records, rude!
I’m mostly interested in data from my InBody scale. But I may also have data written from a Amazfit writsband, a WiThings scale, Cronometer diet tracker, maybe the phone itself. Don’t …
Tinkering with Android’s Health Connect data, the hub for fitness data in the Android ecosystem. I don’t want to mess with their formal APIs so I’m looking to use the nightly full database backups I have it making to Google Drive. They seem to work and contain real data. (This may be a mistake: Health Connect has some semantics implicit in their API I’m having to rediscover by looking at the raw data.)
The result is a .zip file with a single .db file in it, a sqlite3 database. That database has some 73 tables in it but many are empty. So my sexual_activity_record_table shows 0 records, rude!
I’m mostly interested in data from my InBody scale. But I may also have data written from a Amazfit writsband, a WiThings scale, Cronometer diet tracker, maybe the phone itself. Don’t know! Here’s some tables that do have interesting data in them, data that was updated in the last day or two.
Tables seems to come in a couple of types. Some are very simple tables with no app or device identifier and no timezone info. Other tables have complex data with time zone offsets and app and device identifiers. These often are recording cumulative counts for the interval or the like. My theory is the simple data is for old Google Fit APIs and the more complex data is coming from apps using Health Connect APIs. It may be something else.
One thing I’ve learned doing this is Health Connect allows multiple devices and apps to record to the same record of, say, your weight. For my purposes I want to separate those out by ID so I can know whether a weight measure came from the WiThings scale or the InBody scale. Or whatever.
InBody Data
Bottom line: the only useful things this is writing are weight and body fat. I bought the fancy H30 scale that does more precise measures of skeletal muscle mass. They are not recording this data to Health Connect, disappointing. (I do wonder if they can: Health Connect seems to have fixed categories of data.) InBody doesn’t seem to have any other data export options, either. Ugh.
- weight_record_table (WiThings also writing data)
- body_fat_record_table (Inbody writes twice, WiThings also writing data)
- basal_metabolic_rate_record_table (AmazFit also writing this)
Amazfit Data
Bottom line: this is recording a lot of stuff. Steps, Oxygen, Calroies burned, Heart rate, Sleep.
Data is often logged every 10 minutes, but not always. Its data seems to be coming from app ID 1 (Google Fit) and device .
Simple data recorded every N minutes
- heart_rate_record_series_table
- speed_record_table
- activity_date_table
- sleep_stages_table (contains an interval but is simple data)
Complex data recorded every N minutes
- steps_record_table (both phone itself and Amazfit / Zepp)
- distance_record_table
- oxygen_saturation_record_table
- total_calories_burned_record_table (Amazfit and Phone)
- resting_heart_rate_record_table
- sleep_session_record_table (naps vs. full sleep)
Tables with lots of rows but no actual measurements, just time intervals
- heart_rate_record_table
- SpeedRecordTable
Cronometer data
- nutrition_record_table (many columns!)
Phone-originated data
- height_record_table (written once a day)
- activity_intensity_record_table (contains no data?)
Administrative tables and misc data
- read_access_logs_table
- change_log_request_table
- sqlite_sequence
- preference_table
- health_data_category_priority_table
- device_info_table
- application_info_table
- android_metadata
From this I learned some device and app IDs.
Devices
- 1: ? (seems to be my AmazFit)
- 2: Withings
- 3: ? (also my AmazFit?)
- 4: my Pixel 8 phone
Apps
- 1: Google Fit (coming from other systems?)
- 2: Withings
- 3: Google Play services (???)
- 4: Android Shell (???)
- 5: Zepp, which is the Amazfit fitness band
- 6: Cronometer
- 7: InBody
- 8: OMRON Connect, a blood pressure monitor
- 9: Health Sync, an app I installed