Class Info |
|---|
public class ActivityRecordReadOptions Request parameter for reading activity records from Health Service Kit. |
Java
// Note that startTime and endTime respectively indicate the start time and end time of the activity record to be read. You can define them by yourself.
ActivityRecordReadOptions readOption = new ActivityRecordReadOptions.Builder()
.setTimeInterval(startTime, endTime, TimeUnit.MILLISECONDS)
.readActivityRecordsFromAllApps()
.read(DataType.DT_CONTINUOUS_STEPS_DELTA)
.build(); Kotlin
// Note that startTime and endTime respectively indicate the start time and end time of the activity record to be read. You can define them by yourself.
val readRequest = ActivityRecordReadOptions.Builder()
.setTimeInterval(startTime, endTime, TimeUnit.MILLISECONDS)
.readActivityRecordsFromAllApps()
.read(DataType.DT_CONTINUOUS_STEPS_DELTA)
.build()
Qualifier and Type | Class Name and Description |
|---|---|
public static class | ActivityRecordReadOptions.Builder Builder for ActivityRecordReadOptions. |
Qualifier and Type | Method Name and Description |
|---|---|
List<DataType> | Obtains the data types to be read in the current request. |
long | getEndTime(TimeUnit timeUnit) Obtains the end time of the data to be read. |
List<String> | Obtains the package names of all excluded apps. |
long | getStartTime(TimeUnit timeUnit) Obtains the start time of the data to be read. |
boolean | Checks whether the data to be read includes the activity records of all apps. |
List<Integer> | Obtains the activity types of an activity record to be read in the current request. |
Method |
|---|
public List<DataType> getDataTypes() Obtains the data types to be read in the current request. |
Returns
Type | Description |
|---|---|
List<DataType> | List of data types to be read. If none has been specified, the returned list will be empty. |
Method |
|---|
public long getEndTime(TimeUnit timeUnit) Obtains the end time of the data to be read. |
Parameters
Name | Description |
|---|---|
timeUnit | Time unit. |
Returns
Type | Description |
|---|---|
long | End time of the data to be read. |
Method |
|---|
public List<String> getRemoveApplications() Obtains the package names of all excluded apps. |
Returns
Type | Description |
|---|---|
List<String> | List of package names of all excluded apps. If none has been specified, the returned list will be empty. |
Method |
|---|
public long getStartTime(TimeUnit timeUnit) Obtains the start time of the data to be read. |
Parameters
Name | Description |
|---|---|
timeUnit | Time unit. |
Returns
Type | Description |
|---|---|
long | Start time. |