Class Info |
|---|
public static class Builder Builder for ActivityRecord. |
Qualifier and Type | Method Name and Description |
|---|---|
build() Builds and returns the activity record instance. | |
ActivityRecord.Builder | setActiveTime(long activeTime, TimeUnit timeUnit) Sets the active time of the activity record based on the passed time unit. |
ActivityRecord.Builder | setActivitySummary(ActivitySummary activitySummaryParam) Sets ActivitySummary based on the passed object. |
ActivityRecord.Builder | setActivityTypeId(String activityType) Sets the activity type associated with the activity record. |
ActivityRecord.Builder | setAppInfo(AppInfo appInfo) Sets the app information of the activity record. |
ActivityRecord.Builder | setDesc(String description) Sets the description of the activity record. The input parameter can be null, an empty string, or a string of 1 to 1000 characters. |
ActivityRecord.Builder | setDeviceInfo(DeviceInfo deviceInfo) Sets the device information of an activity record. |
ActivityRecord.Builder | setDurationTime(long time, TimeUnit timeUnit) Sets the duration of the activity record based on the passed time unit. |
ActivityRecord.Builder | setEndTime(long endTime, TimeUnit timeUnit) Sets the end time of the activity record based on the passed time unit. |
ActivityRecord.Builder | setId(String identifier) Sets the ID of the activity record, which is unique across all activity records owned by the user. The input parameter can be a string of 1 to 1000 characters. |
ActivityRecord.Builder | setMetadata(String metadata) Sets the metadata in the activity record. |
ActivityRecord.Builder | setName(String sessionName) Sets the name of the activity record. The input parameter can be null or a string of 1 to 980 characters. |
ActivityRecord.Builder | setStartTime(long startTime, TimeUnit timeUnit) Sets the start time of the activity record based on the passed time unit. |
ActivityRecord.Builder | setTimeZone(String timeZone) Sets the time zone. |
Method |
|---|
public ActivityRecord build() Builds and returns the activity record. |
Returns
Type | Description |
|---|---|
Activity record. |
Method |
|---|
public ActivityRecord.Builder setActivityTypeId(String activityType) Sets the activity type associated with the activity record. |
Parameters
Name | Description |
|---|---|
activityType | Activity type. |
Returns
Type | Description |
|---|---|
ActivityRecord.Builder | Builder. |
Method |
|---|
public ActivityRecord.Builder setDesc(String description) Sets the description of the activity record. |
Parameters
Name | Description |
|---|---|
description | Activity description. |
Returns
Type | Description |
|---|---|
ActivityRecord.Builder | Builder. |
Method |
|---|
public ActivityRecord.Builder setDeviceInfo(DeviceInfo deviceInfo) Sets the device information of an activity record. NOTE: Health Service Kit does not collect device information. You can pass device information as required. Leaving it empty does not affect the normal use of the SDK. |
Parameters
Name | Description |
|---|---|
deviceInfo | Device information. |
Returns
Type | Description |
|---|---|
ActivityRecord.Builder | Builder. |
Method |
|---|
public ActivityRecord.Builder setDurationTime(long time, TimeUnit timeUnit) Sets the duration of the activity record based on the passed time unit. |
Parameters
Name | Description |
|---|---|
time | Activity duration. |
timeUnit | Time unit. |
Returns
Type | Description |
|---|---|
ActivityRecord.Builder | Builder. |
Method |
|---|
public ActivityRecord.Builder setActiveTime(long activeTime, TimeUnit timeUnit) Sets the active time of the activity record based on the passed time unit. |
Parameters
Name | Description |
|---|---|
activeTime | Active time of an activity record. |
timeUnit | Time unit. |
Returns
Type | Description |
|---|---|
ActivityRecord.Builder | Builder. |
Method |
|---|
public ActivityRecord.Builder setEndTime(long endTime, TimeUnit timeUnit) Sets the end time of the activity record based on the passed time unit. If the end time is not specified, the activity record is considered as still being in progress. |
The end time must be later than the UNIX timestamp corresponding to 00:00 on January 1, 2014.
Parameters
Name | Description |
|---|---|
endTime | End time. |
timeUnit | Time unit. |
Returns
Type | Description |
|---|---|
ActivityRecord.Builder | Builder. |
Method |
|---|
public ActivityRecord.Builder setId(String identifier) Sets the ID of the activity record. |
Parameters
Name | Description |
|---|---|
identifier | ID of the activity record. |
Returns
Type | Description |
|---|---|
ActivityRecord.Builder | Builder. |
Method |
|---|
public ActivityRecord.Builder setName(String sessionName) Sets the name of the activity record. |
Parameters
Name | Description |
|---|---|
sessionName | Name of the activity record. |
Returns
Type | Description |
|---|---|
ActivityRecord.Builder | Builder. |
Method |
|---|
public ActivityRecord.Builder setStartTime(long startTime, TimeUnit timeUnit) Sets the start time of the activity record based on the passed time unit. |
Parameters
Name | Description |
|---|---|
startTime | Start time, as a UNIX timestamp. NOTE: The start time must be later than the UNIX timestamp corresponding to 00:00 on January 1, 2014. |
timeUnit | Time unit. |
Returns
Type | Description |
|---|---|
ActivityRecord.Builder | Builder. |
Method |
|---|
public ActivityRecord.Builder setActivitySummary(ActivitySummary activitySummaryParam) Sets ActivitySummary based on the passed object. |
Parameters
Name | Description |
|---|---|
activitySummaryParam | Activity summary. |
Returns
Type | Description |
|---|---|
ActivityRecord.Builder | Builder. |
Method |
|---|
public ActivityRecord.Builder setTimeZone(String timeZone) Sets the time zone. |
Parameters
Name | Description |
|---|---|
timeZone | Time zone. |
Returns
Type | Description |
|---|---|
ActivityRecord.Builder | Builder. |
Method |
|---|
public ActivityRecord.Builder setMetadata(String metadata) Sets the metadata in the activity record. |
Parameters
Name | Description |
|---|---|
metadata | Metadata, which can be defined as a character string in JSON format. The value can be null, an empty string, or a string of 1 to 10000 characters. |
Returns
Type | Description |
|---|---|
ActivityRecord.Builder | Builder. |
Method |
|---|
public ActivityRecord.Builder setAppInfo(AppInfo appInfo) Sets the app information of the activity record. |
Parameters
Name | Description |
|---|---|
appInfo | App information of the activity record. |
Returns
Type | Description |
|---|---|
ActivityRecord.Builder | Builder. |