diff --git a/docs/platform-integration/device/sensors.md b/docs/platform-integration/device/sensors.md index 6098827e70..81795681c0 100644 --- a/docs/platform-integration/device/sensors.md +++ b/docs/platform-integration/device/sensors.md @@ -1,5 +1,5 @@ --- -title: Accessing device sensors overview +title: Accessing device sensors description: "Learn how to use and monitor sensors provided by your device, with .NET MAUI. You can monitor the following sensors: accelerometer, barometer, compass, shake, gyroscope, magnetometer, orientation." ms.topic: overview ms.date: 02/02/2023 @@ -16,7 +16,7 @@ Device sensor-related types are available in the `Microsoft.Maui.Devices.Sensors ## Sensor speed -Sensor speed sets the speed in which a sensor will return data to your app. When you start a sensor, you provide the desired sensor speed with the enumeration. +Sensor speed sets the speed in which a sensor will return data to your app. When you start a sensor, you provide the desired sensor speed with the enumeration: - \ Get the sensor data as fast as possible (not guaranteed to return on UI thread). @@ -24,15 +24,26 @@ Get the sensor data as fast as possible (not guaranteed to return on UI thread). - \ Rate suitable for games (not guaranteed to return on UI thread). -- \ -Default rate suitable for screen orientation changes. - - \ Rate suitable for general user interface. +- \ +Default rate suitable for screen orientation changes. + > [!WARNING] > Monitoring too many sensors at once may affect the rate sensor data is returned to your app. +::: moniker range=">=net-maui-8.0" + +In .NET 8, intervals are identical across all platforms: + +- uses an interval of 200ms. +- uses an interval of 60ms. +- uses an interval of 20ms. +- uses an interval of 5ms. + +::: moniker-end + ### Sensor event handlers Event handlers added to sensors with either the or speeds **aren't** guaranteed to run on the UI thread. If the event handler needs to access user-interface elements, use the [`MainThread.BeginInvokeOnMainThread`](../appmodel/main-thread.md) method to run that code on the UI thread. diff --git a/docs/whats-new/dotnet-8.md b/docs/whats-new/dotnet-8.md index 1fbce26f37..fe84188993 100644 --- a/docs/whats-new/dotnet-8.md +++ b/docs/whats-new/dotnet-8.md @@ -19,6 +19,7 @@ For information about what's new in .NET 8, see [What's new in .NET 8](/dotnet/c - gains a `StartPath` property, a `TryDispatchAsync` method, and enhanced logging capabilities. For more information, see [Host a Blazor web app in a .NET MAUI app using BlazorWebView](~/user-interface/controls/blazorwebview.md). - gains `PointerPressedCommand`, `PointerPressedCommandParameter`, `PointerReleasedCommand`, `PointerReleasedCommandParameter` properties, and `PointerPressed` and `PointerReleased` events. For more information, see [Recognize a pointer gesture](~/fundamentals/gestures/pointer.md). - gains a `IsSupportedAsync` method that determines whether a flashlight is available on the device. For more information, see [Flashlight](~/platform-integration/device/flashlight.md). +- intervals have been unified across all platforms. For more information, see [Accessing device sensors](~/platform-integration/device/sensors.md). The following members have been deprecated: