Repository navigation
Share With Other Apps
Status: In every build. Off until the user turns it on. Audience: Users and contributors. Implementation:
sharing,sharing/contract,features/settings. Navigation:Screen.SettingsDataSharing; settings sectionDATA_SHARING. Related: Feature map, Settings and preferences, Permissions, Privacy.
Other apps can read OpenVitals data through a read-only Android content provider. The data is split into 11 groups. An app asks for each group on its own, and the user allows or denies each one.
- The switch. Settings, Share with other apps. It starts off. While it is off, the provider returns no data.
- Each group, for each app. A group is an Android runtime permission. Android shows its own Allow or Deny dialog when an app asks. The user changes it later in Android's settings for that app.
- Health Connect data in the background. An app usually asks while OpenVitals is closed. Health Connect then gives OpenVitals only its own records, unless the user allows background reads. The screen offers that grant when it is missing.
The screen also lists every app that has asked: what it may read now, when it last asked, a link to that app's Android settings, and a button to remove it from the list.
| Group | Contents |
|---|---|
| Activity | steps, distance, floors, elevation, wheelchair pushes, calories |
| Workouts | workouts, workout plans, speed, power, cadence, splits, the heart-rate recovery test |
| Workout routes | GPS routes. A group of its own, because a route shows where the user has been. |
| Sleep | sessions and stages, sleep score, efficiency |
| Heart | heart rate, resting heart rate, HRV, maximum heart rate |
| Vitals | blood pressure, SpO2, breathing rate, temperatures, VO2 max, blood glucose |
| Body | weight, height, body composition, BMR, BMI, FFMI |
| Nutrition | food and nutrients, hydration, caffeine |
| Recovery | Body Energy, mindfulness |
| Cycle | periods, fertility signs, predictions, the cycle journal, pill intakes. Journal notes are never shared. |
| Sexual activity | sexual activity records. A group of its own, because it is the most private. |
Medical records are not shared.
- The 11 permissions, the provider, the switch, the access log and the settings screen.
-
/groups(which groups the calling app holds, and why data may be missing) and/metrics(the full catalog). - Health Connect data for every group:
- daily values through the same repository reads as the PDF report, so the Room caches apply. A day is a day in the phone's time zone; a night belongs to the day it ends on.
-
samples straight from the records, up to 48 hours per query, mapped in
healthconnect/SharedSamplesHealthReader. They are screen reads: paced, counted and behind the one rate-limit backoff, so a refusal makes the answerrate_limitedat once. - sessions for workouts (recorded and planned), sleep and mindfulness, each session's summary, and a workout's route.
- A recorded workout as a file:
workouts/sessions/<session_id>/fit, the FIT file "Save as FIT" writes (features/activity/ActivityWorkoutFitFile). It is opened, not queried.?route=trueadds the GPS track and needs the routes group too. A file cannot say what is missing from it, so anything short of the whole file is refused: theFileNotFoundException's message starts with the status and a colon (sharing_off:,background_read_missing:,rate_limited:,partial:, ornot_found:when no recorded workout has the id) and names no workout. - OpenVitals' own data, with origin
openvitals:- stored in the app: Body Energy as last computed (days and 5-minute buckets), the cycle journal and pill intakes. These need no Health Connect access, so they arrive even when Health Connect cannot be read.
-
worked out on request, with the same functions the screens use (they live in the
health-calculationslibrary): the sleep score, efficiency, WASO and midpoint; BMI, FFMI and the BMR estimate as of each day; the maximum heart rate the load estimates use; the caffeine curve; the cycle day, phase, predicted window, averages and thermal shift as they stood on each day; a workout's moving time, maxima, recovery drop and splits.
- Not served: readiness, stress, HRV status, cardio load and intensity minutes. They cost too many Health Connect reads to compute on request. They are not in the catalog, and can join it without a new API version once the app keeps a daily record of them.
Health Connect data needs four things, or the answer says why it is missing: sharing on, Health Connect available and not paused, and the background-read grant. OpenVitals' stored data still arrives. Without the history grant, Health Connect serves the last 30 days and the cursor says where the data starts. A read OpenVitals has no permission for, or one that fails, makes the answer partial; the other rows are still right.
How a day's value is chosen:
| Value | Rule |
|---|---|
| Maximum heart rate | one row, for the last day of the range: the observed maximum looks a year back |
| Body measurements for BMI and FFMI | the last one on or before the day |
| Cycle values | only what was recorded by that day |
| Period flow | the day's heaviest |
| Mucus and ovulation tests | the day's last reading |
A query runs on one of the provider's binder threads and has 20 seconds; a slower one answers partial with no rows. At most four queries wait at once, over every calling app; one more answers rate_limited.
The URI and column contract lives in sharing/contract/DataSharingContract.kt and DataSharingMetrics.kt.
Generated from docs/features/data-sharing.md. Edit it there; changes made here are overwritten.
This wiki mirrors the Markdown in Hale-MTU/OpenVitals on every push to main.
Features
- Features
- Achievements
- Activity And Training Plans
- Activity Metrics
- Apple Health Import
- Beverage Logging And Caffeine
- Bluetooth LE Sensors
- Body Energy
- Body Metrics
- CoMaps Navigation Context
- CSV Import
- Cycle Tracking
- Daily Readiness
- Elevation Correction
- Feature Map
- FIT Files Import
- Food Logging
- GPX/KML/KMZ/TCX Route Import
- Health Connect Metrics Dashboard
- Health Report Export
- Heart And Vitals
- Heart Rate Recovery
- Home Screen Widgets
- Hydration
- Manual Entry Of Metrics
- Medical Records
- Metric Detail Customization
- Mindfulness
- Non Health Connect Metrics Dashboard
- Nutrition
- Offline Maps Support
- Onboarding And Permissions
- Preloaded Beverage Nutrition Reference
- Privacy, Support, And Diagnostics
- Recording Of Activity
- Reminders
- Settings And Preferences
- Share With Other Apps
- Sleep Score And Recovery
- Sleep Tracking
- Statistics
- Sync With Another Phone
How-to
App
- App Guide
- FAQ
- Getting Started
- Health Connect
- Install
- Local And Connected Editions
- Permissions
- Privacy
- Screenshots
- Support
Reference
- Design Reference
- Reference
- Design Guidelines for Offline & Sync
- OpenVitals UI Notes
- Reference: Data Capture
- Reference: Data Display
- Reference: Health Connect Matchmaking
- Reference: Health Connect Onboarding
- Reference: Health Connect Permissions
- Reference: Health Connect UX
- Reference: Promoting Health Connect
Engineering
- Code Analysis
- Engineering
- Flutter ↔ Kotlin test-parity matrix
- apple-health-import
- Architecture
- body-cycle-recovery
- Design system conformance
- Development
- Feature Playbook
- Flutter -> Kotlin test parity: domain/data/core/contract/state/navigation/di/bootstrap/l10n/widget_test
- Flutter → Kotlin test-parity matrix: features section
- Flutter → Kotlin test-parity matrix: ui / goldens / integration / fixtures
- Flutter-to-Kotlin test-parity matrix — dashboard + devicesync
- manual-entry
- Translations
Proposals
- Proposals
- Activity Start Flow Analysis
- Activity Start Flow Simplification Proposals
- Caffeine Detail And Future Sleep Insights
- Cycle Tracking: Design and Status
- Medical Records Through Health Connect
- Medical Records: What Is Left
Releases
- OpenVitals 2.17.0
- OpenVitals 2.16.0
- OpenVitals 2.15.2
- OpenVitals 2.15.1
- OpenVitals 2.15.0
- OpenVitals 2.14.5
- OpenVitals 2.14.4
- OpenVitals 2.14.3
- OpenVitals 2.14.2
- OpenVitals 2.14.1
- OpenVitals 2.14.0
- OpenVitals 2.13.0
- OpenVitals 2.12.0
- OpenVitals 2.11.2
- OpenVitals 2.11.1
- OpenVitals 2.11.0
- OpenVitals 2.10.1
- OpenVitals 2.10.0
- OpenVitals 2.9.1
- OpenVitals 2.9.0
- OpenVitals 2.8.0
- OpenVitals 2.7.3
- OpenVitals 2.7.2
- OpenVitals 2.7.1
- OpenVitals 2.7.0
- OpenVitals 2.6.6
- OpenVitals 2.6.5
- OpenVitals 2.6.4
- OpenVitals 2.6.3
- OpenVitals 2.6.2
- OpenVitals 2.6.1
- OpenVitals 2.6.0
- OpenVitals 2.5.0
- OpenVitals 2.4.1
- OpenVitals 2.4.0
- OpenVitals 2.3.2
- OpenVitals 2.3.1
- OpenVitals 2.3.0
- OpenVitals 2.2.8
- OpenVitals 2.2.7
- OpenVitals 2.2.6
- OpenVitals 2.2.5
- OpenVitals 2.2.4
- OpenVitals 2.2.3
- OpenVitals 2.2.2
- OpenVitals 2.2.1
- OpenVitals 2.2.0
- OpenVitals 2.1.0
- OpenVitals 2.0.4
- OpenVitals 2.0.3
- OpenVitals 2.0.2
- OpenVitals 2.0.1
- OpenVitals 1.9.0
- OpenVitals 1.8.0
- OpenVitals 1.7.7
- OpenVitals 1.7.6
- OpenVitals 1.7.5
- OpenVitals 1.7.4
- OpenVitals 1.7.3
- OpenVitals 1.7.2
- OpenVitals 1.7.1
- OpenVitals 1.7.0
- OpenVitals 1.6.3
- OpenVitals 1.6.2
- OpenVitals 1.6.1
- OpenVitals 1.6.0
- OpenVitals 1.5.1
- OpenVitals 1.5.0
Project