FusedOrientationProviderClient

  • FusedOrientationProviderClient is the main way to interact with the Fused Orientation Provider.

  • You can request device orientation updates using requestOrientationUpdates.

  • You can stop receiving device orientation updates using removeOrientationUpdates.

  • Orientation updates are only delivered while the requesting app is in the foreground.

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.