DefaultTileClient
class DefaultTileClient : TileClient
Implementation of TileClient which can connect to a TileService in either the local process, or in a remote app.
This implementation will only stay connected for as long as required. Each call will cause this client to connect to the TileService, and call the specified remote method. It will then disconnect again after one second of inactivity (so calls in quick succession will share the same binder).
Note that there is a timeout of 10s when connecting to the TileService, and a timeout of 30s for requestTile and requestResources to return a payload.
Summary
Public constructors |
|---|
DefaultTileClient(Build an instance of |
DefaultTileClient(Build an instance of |
Public functions |
|
|---|---|
open ListenableFuture<Int> |
Gets the API version supported by the connected TileService. |
open ListenableFuture<ResourceBuilders.Resources> |
This function is deprecated. Use |
open ListenableFuture<TileBuilders.Tile> |
requestTile(requestParams: RequestBuilders.TileRequest)Request a tile payload from the connected TileService. |
open ListenableFuture<ResourceBuilders.Resources> |
requestTileResourcesAsync(Request a resource bundle from the connected TileService. |
open ListenableFuture<Void?> |
Send a Tile Added notification to the connected TileService. |
open ListenableFuture<Void?> |
Send a Tile Enter notification to the connected TileService. |
open ListenableFuture<Void?> |
Send a Tile Leave notification to the connected TileService. |
open ListenableFuture<Void?> |
Send a Tile Removed notification to the connected TileService. |
Public constructors
DefaultTileClient
DefaultTileClient(
context: Context,
componentName: ComponentName,
executor: Executor
)
Build an instance of DefaultTileClient for use with a given Executor.
| Parameters | |
|---|---|
context: Context |
The application context to use when binding to the |
componentName: ComponentName |
The |
executor: Executor |
An |
DefaultTileClient
DefaultTileClient(
context: Context,
componentName: ComponentName,
coroutineScope: CoroutineScope,
coroutineDispatcher: CoroutineDispatcher
)
Build an instance of DefaultTileClient for use with a coroutine dispatcher.
| Parameters | |
|---|---|
context: Context |
The application context to use when binding to the |
componentName: ComponentName |
The |
coroutineScope: CoroutineScope |
A |
coroutineDispatcher: CoroutineDispatcher |
A |
Public functions
requestApiVersion
open fun requestApiVersion(): ListenableFuture<Int>
Gets the API version supported by the connected TileService.
requestResources
open funrequestResources(requestParams: RequestBuilders.ResourcesRequest): ListenableFuture<ResourceBuilders.Resources>
Request a resource bundle from the connected TileService.
requestTile
open fun requestTile(requestParams: RequestBuilders.TileRequest): ListenableFuture<TileBuilders.Tile>
Request a tile payload from the connected TileService.
requestTileResourcesAsync
open fun requestTileResourcesAsync(
requestParams: RequestBuilders.ResourcesRequest
): ListenableFuture<ResourceBuilders.Resources>
Request a resource bundle from the connected TileService.
sendOnTileAddedEvent
open fun sendOnTileAddedEvent(): ListenableFuture<Void?>
Send a Tile Added notification to the connected TileService.
sendOnTileEnterEvent
open fun sendOnTileEnterEvent(): ListenableFuture<Void?>
Send a Tile Enter notification to the connected TileService.
sendOnTileLeaveEvent
open fun sendOnTileLeaveEvent(): ListenableFuture<Void?>
Send a Tile Leave notification to the connected TileService.
sendOnTileRemovedEvent
open fun sendOnTileRemovedEvent(): ListenableFuture<Void?>
Send a Tile Removed notification to the connected TileService.