# Android Health Connect - Available Data Types Research

**Date**: 2026-01-12  
**Platform**: Android Health Connect API  
**Source**: https://developer.android.com/health-and-fitness/guides/health-connect/plan/data-types

---

## Overview

Android Health Connect is a unified API that allows apps to read and write health and fitness data from a central on-device store. It's compatible with Android SDK 28 (Pie) and higher.

**Key Points**:
- Requires explicit user permissions for each data type
- All data is stored locally on the device
- Apps can read/write data with user consent
- Supports medical records and health data
- Privacy-focused design

---

## Complete Data Types Catalog (41 Types)

### 🏃 Physical Activity & Movement

| Data Type | Description | Use Case |
|-----------|-------------|----------|
| **StepsRecord** | Step count over time | Daily activity tracking |
| **DistanceRecord** | Distance traveled | Walking/running/cycling distances |
| **FloorsClimbedRecord** | Number of floors climbed | Stair climbing activity |
| **ElevationGainedRecord** | Elevation gained | Hiking/mountain activities |
| **SpeedRecord** | Speed measurement | Running/cycling pace |
| **StepsCadenceRecord** | Steps per minute | Running/cycling cadence |
| **CyclingPedalingCadenceRecord** | Pedal cadence | Cycling performance |
| **WheelchairPushesRecord** | Wheelchair pushes | Accessibility tracking |
| **ExerciseSessionRecord** | Complete workout sessions | Gym/fitness activities |
| **PlannedExerciseSessionRecord** | Scheduled workouts | Workout planning |
| **ActivityIntensityRecord** | Activity intensity levels | Exercise intensity zones |

---

### 💪 Body Composition & Measurements

| Data Type | Description | Use Case |
|-----------|-------------|----------|
| **WeightRecord** | Body weight | Weight tracking |
| **HeightRecord** | Height | BMI calculations |
| **BodyFatRecord** | Body fat percentage | Body composition |
| **BodyWaterMassRecord** | Body water mass | Hydration tracking |
| **BoneMassRecord** | Bone mass | Bone health |
| **LeanBodyMassRecord** | Lean muscle mass | Fitness progress |

---

### ❤️ Heart & Cardiovascular

| Data Type | Description | Use Case |
|-----------|-------------|----------|
| **HeartRateRecord** | Real-time heart rate | Heart rate monitoring |
| **RestingHeartRateRecord** | Resting heart rate | Cardiovascular health |
| **HeartRateVariabilityRmssdRecord** | HRV (RMSSD) | Stress/recovery tracking |
| **BloodPressureRecord** | Systolic/diastolic pressure | Hypertension monitoring |
| **RespiratoryRateRecord** | Breaths per minute | Respiratory health |
| **Vo2MaxRecord** | Maximum oxygen uptake | Cardiovascular fitness |
| **OxygenSaturationRecord** | Blood oxygen levels (SpO2) | Oxygen monitoring |

---

### 🌡️ Temperature & Metabolism

| Data Type | Description | Use Case |
|-----------|-------------|----------|
| **BodyTemperatureRecord** | Body temperature | Fever/health monitoring |
| **BasalBodyTemperatureRecord** | Basal body temperature | Fertility tracking |
| **SkinTemperatureRecord** | Skin temperature | Sleep/stress monitoring |
| **BasalMetabolicRateRecord** | BMR | Metabolism tracking |

---

### 🔥 Calories & Energy

| Data Type | Description | Use Case |
|-----------|-------------|----------|
| **ActiveCaloriesBurnedRecord** | Calories from activity | Exercise calorie burn |
| **TotalCaloriesBurnedRecord** | Total daily calories | Complete energy expenditure |

---

### 💧 Hydration & Nutrition

| Data Type | Description | Use Case |
|-----------|-------------|----------|
| **HydrationRecord** | Water intake | Hydration tracking |
| **NutritionRecord** | Detailed nutrition data | Diet/macronutrient tracking |

---

### 💤 Sleep & Mindfulness

| Data Type | Description | Use Case |
|-----------|-------------|----------|
| **SleepSessionRecord** | Complete sleep sessions | Sleep analysis |
| **MindfulnessSessionRecord** | Meditation/mindfulness | Mental wellness |

---

### 🩸 Women's Health

| Data Type | Description | Use Case |
|-----------|-------------|----------|
| **MenstruationPeriodRecord** | Menstrual cycle | Period tracking |
| **MenstruationFlowRecord** | Flow intensity | Cycle details |
| **IntermenstrualBleedingRecord** | Spotting between periods | Cycle health |
| **CervicalMucusRecord** | Cervical mucus | Fertility tracking |
| **OvulationTestRecord** | Ovulation test results | Fertility planning |
| **SexualActivityRecord** | Sexual activity logs | Health tracking |

---

### 🩺 Blood & Medical

| Data Type | Description | Use Case |
|-----------|-------------|----------|
| **BloodGlucoseRecord** | Blood glucose levels | Diabetes management |

---

### ⚡ Power & Performance

| Data Type | Description | Use Case |
|-----------|-------------|----------|
| **PowerRecord** | Power output | Cycling/rowing performance |
| **ForceRecord** | Force measurement | Strength training |

---

## Permissions Model

Each data type requires specific health permissions:

### Examples of Permission Strings
- `android.permission.health.READ_STEPS`
- `android.permission.health.WRITE_STEPS`
- `android.permission.health.READ_HEART_RATE`
- `android.permission.health.WRITE_HEART_RATE`
- `android.permission.health.READ_BLOOD_PRESSURE`
- `android.permission.health.WRITE_BLOOD_PRESSURE`

**Important**: Users must grant each permission individually through the Health Connect interface.

---

## Data Structure Format

Most records follow this structure:
```kotlin
Record(
    startTime: Instant,
    startZoneOffset: ZoneOffset,
    endTime: Instant,
    endZoneOffset: ZoneOffset,
    metadata: Metadata {
        id: String,
        dataOrigin: DataOrigin,
        lastModifiedTime: Instant,
        clientRecordId: String?,
        device: Device?,
        recordingMethod: RecordingMethod?
    }
)
```

Example: **BloodPressureRecord**
```kotlin
BloodPressureRecord(
    systolic = Pressure.millimetersOfMercury(120.0),
    diastolic = Pressure.millimetersOfMercury(80.0),
    time = Instant.now(),
    zoneOffset = ZoneOffset.UTC,
    metadata = Metadata(...)
)
```

---

## Medical Records (New Feature)

Health Connect now supports medical records:
- **Medical resource format**: FHIR-based structure
- **Reading medical data**: Requires additional permissions
- **Writing medical data**: Vaccination records, lab results, etc.
- **Data format**: Structured medical records with standardized fields

### Medical Record Types
- Immunizations
- Lab results
- Vital signs
- Medications
- Allergies
- Conditions
- Procedures

---

## Integration Approaches for Normogen

### 1. Direct Health Connect Integration (Recommended)
**Pros**:
- Native Android integration
- No third-party dependencies
- Unified API for all data types
- Privacy-preserving (local storage)

**Cons**:
- Android-only
- Requires Android 9+ (API 28+)
- Need to handle user permissions
- Not available on older Android versions

**Implementation**:
```kotlin
// Dependency
implementation("androidx.health:health-connect-client:1.1.0-alpha07")

// Check availability
val healthConnectManager = HealthConnectManager.getOrCreate(context)
if (healthConnectManager.isAvailable) {
    // Use Health Connect
}
```

### 2. Cross-Platform Wrapper Libraries

**Example**: Flutter Health Package (`health` package on pub.dev)

**Supported Data Types** (limited subset):
- Steps
- Heart rate
- Sleep
- Blood oxygen
- Blood pressure
- Weight
- Height
- Active energy burned
- Total energy burned
- Distance
- Water intake
- Nutrition

**Pros**:
- Cross-platform (iOS & Android)
- Simple API
- Active community

**Cons**:
- Limited data types
- May not support all Health Connect features
- Dependency on third-party maintenance

### 3. Hybrid Approach (Recommended for Normogen)

**Android**: Use native Health Connect API
- Access all 41 data types
- Full permission control
- Medical records support

**iOS**: Use HealthKit
- Equivalent data types
- Similar permission model

**Web/PWA**: Web Bluetooth API (limited)
- Connect to BLE devices directly
- Very limited device support

---

## Data Type Mapping to Normogen Features

| Normogen Feature | Health Connect Data Types |
|-----------------|---------------------------|
| **General Health Stats** | WeightRecord, HeightRecord, BodyFatRecord |
| **Physical Activity** | StepsRecord, DistanceRecord, ExerciseSessionRecord |
| **Heart Monitoring** | HeartRateRecord, RestingHeartRateRecord, HeartRateVariabilityRmssdRecord |
| **Blood Pressure** | BloodPressureRecord |
| **Sleep Tracking** | SleepSessionRecord |
| **Temperature** | BodyTemperatureRecord, BasalBodyTemperatureRecord, SkinTemperatureRecord |
| **Respiration** | RespiratoryRateRecord, OxygenSaturationRecord |
| **Period Tracking** | MenstruationPeriodRecord, MenstruationFlowRecord, CervicalMucusRecord, OvulationTestRecord |
| **Hydration** | HydrationRecord |
| **Nutrition** | NutritionRecord |
| **Blood Glucose** | BloodGlucoseRecord (diabetes) |
| **Lab Results** | Medical records API |
| **Medication** | Medical records API |

---

## Limitations & Considerations

### ⚠️ Missing Data Types
- **Pill identification**: No API for identifying pills by shape/appearance
- **Medication reminders**: Not built into Health Connect (app-level feature)
- **Dental information**: Not covered
- **Medical appointments**: Not covered (calendar events)

### 🔒 Privacy Requirements
- User must grant each permission explicitly
- Cannot force permissions
- Some data types require additional health permissions
- Medical records require special handling

### 📱 Device Compatibility
- **Minimum**: Android 9 (API 28)
- **Optimal**: Android 14 (API 34) for full feature set
- **Health Connect module**: Must be installed from Play Store (on Android 13) or pre-installed (Android 14+)

### 📊 Data Granularity
- **Real-time**: Available (heart rate, steps during exercise)
- **Daily summaries**: Available (most data types)
- **Historical queries**: Supported with time ranges

---

## Implementation Example

### Reading Steps Data

```kotlin
suspend fun readSteps(
    healthConnectManager: HealthConnectManager,
    startTime: Instant,
    endTime: Instant
): List<StepsRecord> {
    val response = healthConnectManager.readRecords(
        ReadRecordsRequest(
            recordType = StepsRecord::class,
            timeRangeFilter = TimeRangeFilter.between(startTime, endTime)
        )
    )
    return response.records
}
```

### Writing Blood Pressure Data

```kotlin
suspend fun writeBloodPressure(
    healthConnectManager: HealthConnectManager,
    systolic: Double,
    diastolic: Double,
    timestamp: Instant
) {
    val record = BloodPressureRecord(
        systolic = Pressure.millimetersOfMercury(systolic),
        diastolic = Pressure.millimetersOfMercury(diastolic),
        time = timestamp,
        zoneOffset = ZoneOffset.systemDefault(),
        metadata = Metadata(
            dataOrigin = DataOrigin("com.normogen.app"),
            lastModifiedTime = Instant.now()
        )
    )
    
    healthConnectManager.insertRecords(listOf(record))
}
```

### Reading Sleep Sessions

```kotlin
suspend fun readSleepSessions(
    healthConnectManager: HealthConnectManager,
    startTime: Instant,
    endTime: Instant
): List<SleepSessionRecord> {
    val response = healthConnectManager.readRecords(
        ReadRecordsRequest(
            recordType = SleepSessionRecord::class,
            timeRangeFilter = TimeRangeFilter.between(startTime, endTime)
        )
    )
    return response.records
}
```

---

## Recommendations for Normogen

### ✅ Use Health Connect For:
1. **All sensor data collection** (steps, heart rate, sleep, etc.)
2. **Physical activity tracking** (exercise sessions, distance, calories)
3. **Women's health features** (period tracking, ovulation, etc.)
4. **Vital signs** (blood pressure, blood glucose, temperature)
5. **Body measurements** (weight, height, body composition)

### ❌ Don't Use Health Connect For:
1. **Medication reminders** - Use app-level scheduling
2. **Pill identification** - Not available in API
3. **Medical appointments** - Use calendar integration
4. **Lab results storage** - Store encrypted on server (as planned)
5. **Dental records** - Custom data model needed

### 🎯 Integration Strategy:
1. **Primary data source**: Health Connect for automatic sensor data
2. **Manual entry**: Allow users to manually input data not available via sensors
3. **Background sync**: Periodic sync with Health Connect to update records
4. **Privacy**: All data synced to server should be encrypted client-side (zero-knowledge)

---

## Next Steps

1. ✅ **Research complete** - All 41 data types documented
2. ⏳ **Create data mapping** - Map Normogen features to Health Connect types
3. ⏳ **Design integration** - Plan permission flow and UI
4. ⏳ **Implement PoC** - Build prototype with key data types
5. ⏳ **iOS equivalent** - Research HealthKit for comparison

---

## Resources

- [Official Documentation](https://developer.android.com/health-and-fitness/guides/health-connect/plan/data-types)
- [GitHub Samples](https://github.com/android/health-samples)
- [Health Connect on Play Store](https://play.google.com/store/apps/details?id=com.google.android.apps.healthdata)
- [Privacy Policy](https://developer.android.com/health-and-fitness/health-connect/privacy)

---

**Generated by**: goose AI assistant  
**Last Updated**: 2026-01-12
