Enum HealthAvailability

java.lang.Object
java.lang.Enum<HealthAvailability>
com.codename1.health.HealthAvailability
All Implemented Interfaces:
Comparable<HealthAvailability>

public enum HealthAvailability extends Enum<HealthAvailability>
Whether a platform health store is usable right now, and if not, why. Check this before anything else -- on Android the provider app may be missing or out of date, which is recoverable by the user.
  • Enum Constant Details

    • AVAILABLE

      public static final HealthAvailability AVAILABLE
      A platform health store is present and usable.
    • LOCAL_ONLY

      public static final HealthAvailability LOCAL_ONLY

      No platform store, but this port keeps health data locally (the simulator, and the desktop and JavaScript ports). Reads and writes work and are durable, but the data is this app's own -- nothing is shared with other apps, and no device or third-party app writes into it.

      Apps that only aggregate their own measurements can treat this as working. Apps whose whole purpose is reading what other apps recorded should tell the user the feature needs a phone.

    • PROVIDER_UPDATE_REQUIRED

      public static final HealthAvailability PROVIDER_UPDATE_REQUIRED
      Android only: the Health Connect provider is installed but too old. Send the user to Health.openProviderSetup().
    • PROVIDER_NOT_INSTALLED

      public static final HealthAvailability PROVIDER_NOT_INSTALLED
      Android only: the Health Connect provider app is not installed. Send the user to Health.openProviderSetup().
    • NOT_SUPPORTED

      public static final HealthAvailability NOT_SUPPORTED
      This platform has no health support at all.
  • Method Details

    • values

      public static HealthAvailability[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      Returns:
      an array containing the constants of this enum type, in the order they are declared
    • valueOf

      public static HealthAvailability valueOf(String name)
      Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum type has no constant with the specified name
      NullPointerException - if the argument is null