ActivitySensor ActivitySensor ActivitySensor ActivitySensor ActivitySensor Class

Definition

Represents an activity sensor that provides the activity and status of a sensor.

For an example implementation, see the activity sensor sample.

public : sealed class ActivitySensor
struct winrt::Windows::Devices::Sensors::ActivitySensor
public sealed class ActivitySensor
Public NotInheritable Class ActivitySensor
// This class does not provide a public constructor.
Attributes

Windows 10 requirements

Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Remarks

Note

This class is not supported in JavaScript

In order to use ActivitySensor, you need to define the activity device capability in your app manifest file.

<Capabilities>
    <DeviceCapability Name="activity"/>
</Capabilities>

Properties

DeviceId DeviceId DeviceId DeviceId DeviceId

Gets the device identifier.

MinimumReportInterval MinimumReportInterval MinimumReportInterval MinimumReportInterval MinimumReportInterval

Gets the minimum report interval supported by the sensor.

PowerInMilliwatts PowerInMilliwatts PowerInMilliwatts PowerInMilliwatts PowerInMilliwatts

Gets the power in milliwatts that the sensor consumes.

SubscribedActivities SubscribedActivities SubscribedActivities SubscribedActivities SubscribedActivities

Gets the list of activity types that the sensor pledges to perform.

SupportedActivities SupportedActivities SupportedActivities SupportedActivities SupportedActivities

Gets the list of activity types that the sensor supports.

Methods

FromIdAsync(String) FromIdAsync(String) FromIdAsync(String) FromIdAsync(String) FromIdAsync(String)

Asynchronously obtains the sensor from its identifier.

GetCurrentReadingAsync() GetCurrentReadingAsync() GetCurrentReadingAsync() GetCurrentReadingAsync() GetCurrentReadingAsync()

Asynchronously gets the current sensor reading.

GetDefaultAsync() GetDefaultAsync() GetDefaultAsync() GetDefaultAsync() GetDefaultAsync()

Asynchronously obtains the default sensor.

GetDeviceSelector() GetDeviceSelector() GetDeviceSelector() GetDeviceSelector() GetDeviceSelector()

Gets the device selector.

GetSystemHistoryAsync(DateTime) GetSystemHistoryAsync(DateTime) GetSystemHistoryAsync(DateTime) GetSystemHistoryAsync(DateTime) GetSystemHistoryAsync(DateTime)

Asynchronously gets sensor readings from a specific time.

GetSystemHistoryAsync(DateTime, TimeSpan) GetSystemHistoryAsync(DateTime, TimeSpan) GetSystemHistoryAsync(DateTime, TimeSpan) GetSystemHistoryAsync(DateTime, TimeSpan) GetSystemHistoryAsync(DateTime, TimeSpan)

Asynchronously gets sensor readings from a specific time and duration.

Events

ReadingChanged ReadingChanged ReadingChanged ReadingChanged ReadingChanged

Occurs each time the sensor reports a new sensor reading.

See also