ListenableWatchFaceMetadataClient


Note: As of July 10, 2024, watch faces must use the Watch Face Format in order to be installed on new watches that launch with Wear OS 5 pre-installed. Learn more about the user-facing changes in this Help Center article.

Additionally, starting in early 2025 (specific date to be announced during Q4 2024), all new watch faces published on Google Play must use the Watch Face Format.

class ListenableWatchFaceMetadataClient


ListenableFuture-based compatibility wrapper around WatchFaceMetadataClient.create.

Summary

Public companion functions

ListenableFuture<WatchFaceMetadataClient>
create(context: Context, watchFaceName: ComponentName)

Constructs a WatchFaceMetadataClient for fetching metadata for the specified watch face.

ListenableFuture<WatchFaceMetadataClient>
createForRuntime(
    context: Context,
    watchFaceName: ComponentName,
    resourceOnlyWatchFacePackageName: String
)

Constructs a WatchFaceMetadataClient for fetching metadata for the specified resource only watch face runtime.

Public companion functions

create

Added in 1.1.0
fun create(context: Context, watchFaceName: ComponentName): ListenableFuture<WatchFaceMetadataClient>

Constructs a WatchFaceMetadataClient for fetching metadata for the specified watch face.

Parameters
context: Context

Calling application's Context.

watchFaceName: ComponentName

The ComponentName of the watch face to fetch meta data from.

Returns
ListenableFuture<WatchFaceMetadataClient>

A ListenableFuture which resolves with WatchFaceMetadataClient if there is one, otherwise it throws a ServiceNotBoundException if the underlying watch face control service can not be bound or a ServiceStartFailureException if the watch face dies during startup.

createForRuntime

Added in 1.2.0
fun createForRuntime(
    context: Context,
    watchFaceName: ComponentName,
    resourceOnlyWatchFacePackageName: String
): ListenableFuture<WatchFaceMetadataClient>

Constructs a WatchFaceMetadataClient for fetching metadata for the specified resource only watch face runtime. A resource only watch face runtime, is a special kind of watch face that is the runtime for a watch face defined by another package that contains only resources and no executable code.

Parameters
context: Context

Calling application's Context.

watchFaceName: ComponentName

The ComponentName of the watch face to fetch meta data from.

resourceOnlyWatchFacePackageName: String

The package the runtime should load the resources from.

Returns
ListenableFuture<WatchFaceMetadataClient>

A ListenableFuture which resolves with WatchFaceMetadataClient if there is one, otherwise it throws a ServiceNotBoundException if the underlying watch face control service can not be bound or a ServiceStartFailureException if the watch face dies during startup.