Package com.codename1.health


package com.codename1.health

Cross-platform health data: reading and writing samples, aggregating them over time, watching the store for changes, and recording workouts.

Start at Health, which is never null on any port. Backed by HealthKit on iOS and watchOS, by Health Connect on Android, by a scriptable virtual store in the simulator, and by a local store on the desktop and JavaScript ports.

Two platform truths this API does not hide

Read authorization is unknowable on iOS. HealthKit reports a denied read as an empty result, deliberately, so that an app cannot infer what a user is choosing to hide. There is therefore no hasReadPermission anywhere in this package, and your UI must say "no data available" rather than "you denied access".

Android never wakes your app for new data. Health Connect has no push mechanism, so subscriptions there are polled when your app runs.

  • com.codename1.health.workout -- live and recorded workout sessions.
  • com.codename1.health.sensors -- Bluetooth GATT health sensors, which work on every port with Bluetooth LE regardless of whether a health store exists.