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.

public final class ListenableWatchFaceMetadataClient


ListenableFuture-based compatibility wrapper around WatchFaceMetadataClient.create.

Summary

Public methods

static final @NonNull ListenableFuture<@NonNull WatchFaceMetadataClient>
create(@NonNull Context context, @NonNull ComponentName watchFaceName)

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

static final @NonNull ListenableFuture<@NonNull WatchFaceMetadataClient>
createForRuntime(
    @NonNull Context context,
    @NonNull ComponentName watchFaceName,
    @NonNull String resourceOnlyWatchFacePackageName
)

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

Public methods

create

Added in 1.1.0
public static final @NonNull ListenableFuture<@NonNull WatchFaceMetadataClientcreate(@NonNull Context context, @NonNull ComponentName watchFaceName)

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

Parameters
@NonNull Context context

Calling application's Context.

@NonNull ComponentName watchFaceName

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

Returns
@NonNull ListenableFuture<@NonNull 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
public static final @NonNull ListenableFuture<@NonNull WatchFaceMetadataClientcreateForRuntime(
    @NonNull Context context,
    @NonNull ComponentName watchFaceName,
    @NonNull String resourceOnlyWatchFacePackageName
)

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
@NonNull Context context

Calling application's Context.

@NonNull ComponentName watchFaceName

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

@NonNull String resourceOnlyWatchFacePackageName

The package the runtime should load the resources from.

Returns
@NonNull ListenableFuture<@NonNull 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.