WatchFaceId

public final class WatchFaceId
extends Object

java.lang.Object
   ↳ com.google.wear.services.watchfaces.WatchFaceId


Each watch face is distributed as an app. Its package name is accessible through getPackageName().

A classic watch face is identified by its service and it is possible to have many watch faces in the app. The ComponentName constructed using getPackageName() and getClassName() should be used to bind to that service.

For resource-only watch faces, the number of watch faces per app is limited to one. In this case getClassName() will return null. @see WatchFaceFormat for more information about resource-only watchfaces.

Summary

Public constructors

WatchFaceId(String packageName)

Constructs WatchFaceId of a resource-only watch face, specifying its package name.

WatchFaceId(String packageName, String className)

Constructs WatchFaceId of a classic watch face, specifying its package name and class name.

Public methods

boolean equals(Object o)

String getClassName()

If it is classic watch face, returns the name of watch face service that represents this watch face.

String getPackageName()

Returns the app package name which contains this watch face.

int hashCode()

String toString()

Inherited methods

Public constructors

WatchFaceId

Added in version 35.1
public WatchFaceId (String packageName)

Constructs WatchFaceId of a resource-only watch face, specifying its package name.

The className is null for resource-only watch faces which don't contain any code in their package. For classic watch faces, use WatchFaceId(String,String).

Parameters
packageName String: The package name of the watch face represented by this WatchFaceId.

WatchFaceId

Added in version 35.1
public WatchFaceId (String packageName, 
                String className)

Constructs WatchFaceId of a classic watch face, specifying its package name and class name.

Since resource-only watch faces don't contain any code, the className for these is set as null. Use WatchFaceId(String) to initialise a WatchFaceId for these watch faces.

Parameters
packageName String: The package name of the watch face represented by this WatchFaceId.

className String: The class name of the watch face service corresponding to this WatchFaceId.

Public methods

equals

Added in version 35.1
public boolean equals (Object o)

Parameters
o Object

Returns
boolean

getClassName

Added in version 35.1
public String getClassName ()

If it is classic watch face, returns the name of watch face service that represents this watch face. Returns null otherwise.

Returns
String

getPackageName

Added in version 35.1
public String getPackageName ()

Returns the app package name which contains this watch face.

Returns
String

hashCode

Added in version 35.1
public int hashCode ()

Returns
int

toString

Added in version 35.1
public String toString ()

Returns
String