目录

ActivityRecord

Class Info

public class ActivityRecord

Activity record class, which records the basic information about an activity of the user. For example, for an outdoor running activity, information including the start time, end time, activity record name, ID, description, activity type (as defined in HiHealthActivities), and activity duration will be recorded.

Nested Class Summary

Qualifier and Type

Class Name and Description

public static class

ActivityRecord.Builder

Builder for ActivityRecord.

Public Field Summary

Qualifier and Type

Field and Description

static final String

EXTRA_ACTIVITY_RECORD

ActivityRecord object contained in additional information.

CAUTION:

This constant has been deprecated.

static final String

MIME_TYPE_PREFIX

General prefix of an activity record.

CAUTION:

This constant has been deprecated.

Public Method Summary

Qualifier and Type

Method Name and Description

Long

getActiveTime(TimeUnit timeUnit)

Obtains the active time of the activity record based on the passed time unit.

String

getActivityType()

Obtains the activity type associated with the activity record. Returns unknown if no return value is set.

ActivitySummary

getActivitySummary()

Obtains the activity summary.

String

getAppDetailsUrl()

Obtains the detailed URL of the app related to the activity record.

String

getAppDomainName()

Obtains the domain name related to the activity record.

AppInfo

getAppInfo()

Obtains the app information related to the activity record.

String

getAppVersion()

Obtains the version of the app that has added the activity record.

String

getDesc()

Obtains the description of the activity record.

DeviceInfo

getDeviceInfo()

Obtains the device information.

long

getDurationTime(TimeUnit timeUnit)

Obtains the duration of the activity record based on the passed time unit.

long

getEndTime(TimeUnit timeUnit)

Obtains the end time of the activity record based on the passed time unit.

String

getId()

Obtains the ID of the activity record.

String

getMetadata()

Obtains the metadata of the activity record.

static String

getMimeType(String type)

Obtains the MIME type of the activity record that describes a particular activity.

CAUTION:

This method has been deprecated.

String

getName()

Obtains the name of the activity record.

String

getPackageName()

Obtains the package name of the app that has added the activity record.

long

getStartTime(TimeUnit timeUnit)

Obtains the start time of the activity record based on the passed time unit.

String

getTimeZone()

Obtains the time zone.

boolean

hasDurationTime()

Indicates whether the activity record has durations.

boolean

isKeepGoing()

Indicates whether an activity record is in progress.

Public Fields

[h2]EXTRA_ACTIVITY_RECORD

Field

public static final String EXTRA_ACTIVITY_RECORD

ActivityRecord object contained in additional information.

Constant value: vnd.huawei.hihealth.activityRecord

CAUTION:

This constant has been deprecated.

[h2]MIME_TYPE_PREFIX

Field

public static final String MIME_TYPE_PREFIX

General prefix of an activity record.

Constant value: vnd.huawei.hihealth.mimeType/

CAUTION:

This constant has been deprecated.

Public Methods

[h2]getActivityType()

Method

public String getActivityType()

Obtains the activity type associated with the activity record. Returns unknown if no return value is set.

Returns

Type

Description

String

Activity type associated with the activity record.

[h2]getAppDetailsUrl()

Method

public String getAppDetailsUrl()

Obtains the detailed URL of the app related to the activity record.

Returns

Type

Description

String

Detailed URL of the app.

[h2]getAppDomainName()

Method

public String getAppDomainName()

Obtains the domain name of the app.

Returns

Type

Description

String

Domain name.

[h2]getAppInfo()

Method

public AppInfo getAppInfo()

Obtains the app information related to the activity record.

Returns

Type

Description

AppInfo

App information.

[h2]getAppVersion()

Method

public String getAppVersion()

Obtains the version of the app that has added the activity record.

Returns

Type

Description

String

App version.

[h2]getDesc()

Method

public String getDesc()

Obtains the description of the activity record.

Returns

Type

Description

String

Description of the activity record.

[h2]getDeviceInfo()

Method

public DeviceInfo getDeviceInfo()

Obtains the device information of the activity record.

Returns

Type

Description

DeviceInfo

Information about the device on which an activity record is generated.

[h2]getDurationTime(TimeUnit timeUnit)

Method

public long getDurationTime(TimeUnit timeUnit)

Obtains the duration of the activity record based on the passed time unit.

Parameters

Name

Description

timeUnit

Time unit.

Returns

Type

Description

long

Activity duration.

[h2]getEndTime(TimeUnit timeUnit)

Method

public long getEndTime(TimeUnit timeUnit)

Obtains the end time of the activity record based on the passed time unit.

Parameters

Name

Description

timeUnit

Time unit.

Returns

Type

Description

long

End time.

[h2]getId()

Method

public String getId()

Obtains the ID of the activity record.

Returns

Type

Description

String

ID of the activity record.

[h2]getMimeType(String type)

Method

public static String getMimeType(String type)

Obtains the MIME type of the activity record that describes a particular activity.

CAUTION:

This method has been deprecated.

Parameters

Name

Description

type

Type.

Returns

Type

Description

String

MIME type of the activity record that describes a particular activity.

[h2]getName()

Method

public String getName()

Obtains the name of the activity record.

Returns

Type

Description

String

Name of the activity record.

[h2]getPackageName()

Method

public String getPackageName()

Obtains the package name of the app that has added the activity record.

Returns

Type

Description

String

Package name of the app.

[h2]getStartTime(TimeUnit timeUnit)

Method

public long getStartTime(TimeUnit timeUnit)

Obtains the start time of the activity record based on the passed time unit.

Parameters

Name

Description

timeUnit

Time unit.

Returns

Type

Description

long

Start time.

[h2]getActivitySummary()

Method

public ActivitySummary getActivitySummary()

Obtains the activity summary.

Returns

Type

Description

ActivitySummary

Activity summary.

[h2]getTimeZone()

Method

public String getTimeZone()

Obtains the time zone.

Returns

Type

Description

String

Time zone.

[h2]hasDurationTime()

Method

public boolean hasDurationTime()

Indicates whether the activity record has durations.

Returns

Type

Description

boolean

Whether the activity record has durations.

[h2]getActiveTime(TimeUnit timeUnit)

Method

public Long getActiveTime(TimeUnit timeUnit)

Obtains the active time of the activity record based on the passed time unit.

Parameters

Name

Description

timeUnit

Time unit.

Returns

Type

Description

Long

Active time of an activity record.

[h2]getMetadata()

Method

public String getMetadata()

Obtains the metadata of the activity record.

Returns

Type

Description

String

Metadata in the activity record.

[h2]isKeepGoing()

Method

public boolean isKeepGoing()

Indicates whether an activity record is in progress. If the activity record has ended, the value false will be returned.

Returns

Type

Description

boolean

Whether an activity record is in progress.