Language

RangingManager.CreateRangingSession Method

Definition

Creates a new ranging session.

[Android.Runtime.Register("createRangingSession", "(Ljava/util/concurrent/Executor;Landroid/ranging/RangingSession$Callback;)Landroid/ranging/RangingSession;", "", ApiSince=36)]
public Android.Ranging.RangingSession? CreateRangingSession(Java.Util.Concurrent.IExecutor executor, Android.Ranging.RangingSession.ICallback callback);
[<Android.Runtime.Register("createRangingSession", "(Ljava/util/concurrent/Executor;Landroid/ranging/RangingSession$Callback;)Landroid/ranging/RangingSession;", "", ApiSince=36)>]
member this.CreateRangingSession : Java.Util.Concurrent.IExecutor * Android.Ranging.RangingSession.ICallback -> Android.Ranging.RangingSession

Parameters

executor
IExecutor

The executor on which the callback will be invoked.

callback
RangingSession.ICallback

The callback to receive session-related events.

Returns

A RangingSession that can initiate, manage, and stop ranging operations if the session is successfully created; otherwise, null.

Attributes

Remarks

Creates a new ranging session. A ranging session enables the application to perform ranging operations using available technologies such as Ultra-Wideband (UWB) or Wi-Fi Round Trip Time (RTT).

The callback receives session-related events, including session start, stop, and ranging updates. Provide an executor that handles callbacks on a suitable thread.

Java documentation for android.ranging.RangingManager.createRangingSession(java.util.concurrent.Executor, android.ranging.RangingSession.Callback).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to