FusedOrientationProviderClient

  • FusedOrientationProviderClient is the primary way to interact with the Fused Orientation Provider (FOP) for accessing device orientation data.

  • You can obtain an instance of FusedOrientationProviderClient through the LocationServices class.

  • It provides methods to request and remove device orientation updates using a DeviceOrientationListener.

  • Orientation updates are delivered only when the app is in the foreground and can be customized with a DeviceOrientationRequest.

public interface FusedOrientationProviderClient implements HasApiKey<Api.ApiOptions.NoOptions>

The main entry point for interacting with the Fused Orientation Provider (FOP). In order to obtain an instance of this class, see LocationServices.

Public Method Summary

abstract Task<Void>
removeOrientationUpdates(DeviceOrientationListener listener)
Removes all device orientation updates for the given listener.
abstract Task<Void>
requestOrientationUpdates(DeviceOrientationRequest request, Executor executor, DeviceOrientationListener listener)
Requests orientation updates with the given request and delivers results to the given listener on the specified Executor.

Public Methods

public abstract Task<Void> removeOrientationUpdates (DeviceOrientationListener listener)

Removes all device orientation updates for the given listener.

public abstract Task<Void> requestOrientationUpdates (DeviceOrientationRequest request, Executor executor, DeviceOrientationListener listener)

Requests orientation updates with the given request and delivers results to the given listener on the specified Executor. A previous request for orientation updates for the same listener will be replaced by this request.

Orientation updates will only be delivered while the requesting app is in foreground.

Use removeOrientationUpdates(DeviceOrientationListener) to stop orientation updates once no longer needed.