HealthConnectManager.ReadRecords Method

Definition

API to read records based on ReadRecordsRequestUsingFilters or ReadRecordsRequestUsingIds

[Android.Runtime.Register("readRecords", "(Landroid/health/connect/ReadRecordsRequest;Ljava/util/concurrent/Executor;Landroid/os/OutcomeReceiver;)V", "GetReadRecords_Landroid_health_connect_ReadRecordsRequest_Ljava_util_concurrent_Executor_Landroid_os_OutcomeReceiver_Handler", ApiSince=34)]
[Java.Interop.JavaTypeParameters(new System.String[] { "T extends android.health.connect.datatypes.Record" })]
public virtual void ReadRecords (Android.Health.Connect.ReadRecordsRequest request, Java.Util.Concurrent.IExecutor executor, Android.OS.IOutcomeReceiver callback);
[<Android.Runtime.Register("readRecords", "(Landroid/health/connect/ReadRecordsRequest;Ljava/util/concurrent/Executor;Landroid/os/OutcomeReceiver;)V", "GetReadRecords_Landroid_health_connect_ReadRecordsRequest_Ljava_util_concurrent_Executor_Landroid_os_OutcomeReceiver_Handler", ApiSince=34)>]
[<Java.Interop.JavaTypeParameters(new System.String[] { "T extends android.health.connect.datatypes.Record" })>]
abstract member ReadRecords : Android.Health.Connect.ReadRecordsRequest * Java.Util.Concurrent.IExecutor * Android.OS.IOutcomeReceiver -> unit
override this.ReadRecords : Android.Health.Connect.ReadRecordsRequest * Java.Util.Concurrent.IExecutor * Android.OS.IOutcomeReceiver -> unit

Parameters

request
ReadRecordsRequest

Read request based on ReadRecordsRequestUsingFilters or ReadRecordsRequestUsingIds

executor
IExecutor

Executor on which to invoke the callback.

callback
IOutcomeReceiver

Callback to receive result of performing this operation.

Attributes

Remarks

API to read records based on ReadRecordsRequestUsingFilters or ReadRecordsRequestUsingIds

Number of records returned by this API will depend based on below factors:

When an app with read permission allowed calls the API from background then it will be able to read only its own inserted records and will not get records inserted by other apps. This may be less than the total records present for the record type.

When an app with read permission allowed calls the API from foreground then it will be able to read all records for the record type.

App with only write permission but no read permission allowed will be able to read only its own inserted records both when in foreground or background.

An app without both read and write permissions will not be able to read any record and the API will throw Security Exception.

Java documentation for android.health.connect.HealthConnectManager.readRecords(android.health.connect.ReadRecordsRequest<T>, java.util.concurrent.Executor, android.os.OutcomeReceiver<android.health.connect.ReadRecordsResponse<T>, android.health.connect.HealthConnectException>).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to