Skip to content

Conversation

iarata
Copy link
Contributor

@iarata iarata commented Jun 5, 2025

The PR for introducing the refactored of Android native implementation. Similarly to the Swift refactor there are now the following files:

HealthPlugin.kt (Main Plugin Class)
├── HealthDataReader.kt (Reading health data)
├── HealthDataWriter.kt (Writing health data)
├── HealthDataOperations.kt (Permissions and utilities)
├── HealthDataConverter.kt (Data conversion)
├── HealthRecordingFilter.kt (Filtering utility)
└── HealthConstants.kt (Constants)

All the files and function are documented as well. Below each files jobs are explained briefly:

  • HealthPlugin.kt (Main Plugin Class)
    • Flutter plugin interface and method channel management
    • Activity lifecycle handling
    • Permission handling
  • HealthDataReader.kt (Reading health data)
    • All data reading operations (getData, getAggregateData, etc.)
    • Handles pagination for large datasets
  • HealthDataWriter.kt (Writing health data)
    • All data writing operations
    • Includes special writing methods for specific data types
  • HealthDataOperations.kt (Permissions and utilities)
    • Permission checking and requesting
    • Data deletion operations
    • Health Connect SDK status, background, and history permissions check
  • HealthDataConverter.kt (Data conversion)
    • Converts Health Connect records to Flutter-compatible maps
  • HealthRecordingFilter.kt (Filtering utility)
    • Filters records by recording methods
  • HealthConstants.kt (Constants)
    • Contains all constants and type mappings
    • Uses Kotlin object for better performance

@iarata iarata self-assigned this Jun 5, 2025
@iarata iarata requested review from bardram and Panosfunk June 5, 2025 01:27
@iarata iarata changed the title Health 13 - Refactored Android Implementation Health 13.1.0 - Refactored Android Implementation Jun 5, 2025
@iarata iarata requested a review from yuanchen233 June 12, 2025 11:11
Copy link

@yuanchen233 yuanchen233 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@iarata iarata merged commit 875a2ed into health-13 Jun 12, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants