Skip to content

feat: add Health Connect session export - #146

Open
0then0 wants to merge 1 commit into
mmazzarolo:masterfrom
0then0:feat/130-health-connect
Open

feat: add Health Connect session export#146
0then0 wants to merge 1 commit into
mmazzarolo:masterfrom
0then0:feat/130-health-connect

Conversation

@0then0

@0then0 0then0 commented Sep 6, 2026

Copy link
Copy Markdown
  • Adds an Android-only Expo native module using Health Connect WRITE_MINDFULNESS.
  • Adds a Settings toggle that requests permission before enabling export.
  • Writes completed breathing exercises as mindfulness sessions without reading health data.
  • Splits sessions around app background periods so inactive time is excluded.
  • Handles unavailable providers, outdated Health Connect, revoked permission, invalid intervals, and native write failures.
  • Persists the toggle safely with validation for malformed stored settings.
  • Adds unit and component tests for permissions, errors, persisted state, background/resume segments, and clock changes.
  • Raises Android minSdkVersion to 26, required by the Health Connect SDK.
  • Ignores local native-module Gradle build output.

Checks before merge/release

  • Confirm that storing a backgrounded exercise as multiple mindfulness records is acceptable. Background time is intentionally excluded.
  • Verify the flow on a physical Android device:
    • Android 9–13 with the Health Connect app installed;
    • Android 14+ with built-in Health Connect;
    • permission grant, permission revocation, provider update requirement, and successful record creation.
  • Review the Android compatibility change: Health Connect requires minSdkVersion 26, so Android 7/API 24–25 will no longer be supported.
  • Before a Google Play release, declare WRITE_MINDFULNESS in Play Console and ensure its Health Connect privacy policy matches the text shown by the in-app rationale activity.
  • Confirm whether partial export is acceptable when one segment saves and another fails. The app reports the failure but does not retry automatically.

Closes #130

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.

Health Connect integration

1 participant