MeasureCallback

public interface MeasureCallback


Callback for MeasureClient.registerMeasureCallback.

Summary

Public methods

abstract void
onAvailabilityChanged(
    @NonNull DeltaDataType<@NonNull ?, @NonNull ?> dataType,
    @NonNull Availability availability
)

Called when the availability of a DataType changes.

abstract void

Called when new data is available.

default void

Called when this callback has been successfully registered with Health Services.

default void

Called when Health Services reports a failure with the registration of this callback.

Public methods

onAvailabilityChanged

Added in 1.0.0
abstract void onAvailabilityChanged(
    @NonNull DeltaDataType<@NonNull ?, @NonNull ?> dataType,
    @NonNull Availability availability
)

Called when the availability of a DataType changes.

Parameters
@NonNull DeltaDataType<@NonNull ?, @NonNull ?> dataType

the DeltaDataType that experienced a change in availability

@NonNull Availability availability

the new Availability status for this dataType

onDataReceived

Added in 1.0.0
abstract void onDataReceived(@NonNull DataPointContainer data)

Called when new data is available. Data may be batched.

Parameters
@NonNull DataPointContainer data

the (potentially batched) set of measured DataPoints corresponding to one or more of the requested DeltaDataTypes

onRegistered

Added in 1.0.0
default void onRegistered()

Called when this callback has been successfully registered with Health Services.

onRegistrationFailed

Added in 1.0.0
default void onRegistrationFailed(@NonNull Throwable throwable)

Called when Health Services reports a failure with the registration of this callback. Common causes include: the calling app lacks the necessary permission, or the device does not support the requested DataType.

Parameters
@NonNull Throwable throwable

a throwable sent by Health Services with information about the failure