Added in [version 35.1](https://developer.android.com/topic/libraries/support-library/revisions) Summary: [Ctors](https://developer.android.com/reference/com/google/wear/services/watchfaces/WatchFaceId#pubctors) \| [Methods](https://developer.android.com/reference/com/google/wear/services/watchfaces/WatchFaceId#pubmethods) \| [Inherited Methods](https://developer.android.com/reference/com/google/wear/services/watchfaces/WatchFaceId#inhmethods)

# WatchFaceId


`
public

final

class
WatchFaceId
`


`

extends Object


`

`


`

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

<br />

*** ** * ** ***

Each watch face is distributed as an app. Its package name is accessible through `https://developer.android.com/reference/com/google/wear/services/watchfaces/WatchFaceId#getPackageName()`.

A classic watch face is identified by its service and it is possible to have many watch faces
in the app. The `https://developer.android.com/reference/android/content/ComponentName` constructed using `https://developer.android.com/reference/com/google/wear/services/watchfaces/WatchFaceId#getPackageName()` and `https://developer.android.com/reference/com/google/wear/services/watchfaces/WatchFaceId#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 `https://developer.android.com/reference/com/google/wear/services/watchfaces/WatchFaceId#getClassName()` will return null. @see [WatchFaceFormat](https://developer.android.com/training/wearables/wff) for more
information about resource-only watchfaces.

## Summary

| ### Public constructors ||
|---|---|
| ` https://developer.android.com/reference/com/google/wear/services/watchfaces/WatchFaceId#WatchFaceId(java.lang.String)(String packageName) ` Constructs WatchFaceId of a resource-only watch face, specifying its package name. |
| ` https://developer.android.com/reference/com/google/wear/services/watchfaces/WatchFaceId#WatchFaceId(java.lang.String,%20java.lang.String)(String packageName, String className) ` Constructs WatchFaceId of a classic watch face, specifying its package name and class name. |

| ### Public methods ||
|---|---|
| ` boolean` | ` https://developer.android.com/reference/com/google/wear/services/watchfaces/WatchFaceId#equals(java.lang.Object)(Object o) ` |
| ` String` | ` https://developer.android.com/reference/com/google/wear/services/watchfaces/WatchFaceId#getClassName()() ` If it is classic watch face, returns the name of watch face service that represents this watch face. |
| ` String` | ` https://developer.android.com/reference/com/google/wear/services/watchfaces/WatchFaceId#getPackageName()() ` Returns the app package name which contains this watch face. |
| ` int` | ` https://developer.android.com/reference/com/google/wear/services/watchfaces/WatchFaceId#hashCode()() ` |
| ` String` | ` https://developer.android.com/reference/com/google/wear/services/watchfaces/WatchFaceId#toString()() ` |

| ### Inherited methods |
|---|---|
| From class ` java.lang.Object ` |---|---| | ` Object` | ` clone() ` | | ` boolean` | ` equals(Object arg0) ` | | ` void` | ` finalize() ` | | ` final Class<?>` | ` getClass() ` | | ` int` | ` hashCode() ` | | ` final void` | ` notify() ` | | ` final void` | ` notifyAll() ` | | ` String` | ` toString() ` | | ` final void` | ` wait(long arg0, int arg1) ` | | ` final void` | ` wait(long arg0) ` | | ` final void` | ` wait() ` | ||

## Public constructors

### WatchFaceId

Added in [version 35.1](https://developer.android.com/topic/libraries/support-library/revisions)

```
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 `https://developer.android.com/reference/com/google/wear/services/watchfaces/WatchFaceId#WatchFaceId(java.lang.String,%20java.lang.String)`.

<br />

| Parameters ||
|---|---|
| `packageName` | `String`: The package name of the watch face represented by this WatchFaceId. <br /> |

### WatchFaceId

Added in [version 35.1](https://developer.android.com/topic/libraries/support-library/revisions)

```
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 `https://developer.android.com/reference/com/google/wear/services/watchfaces/WatchFaceId#WatchFaceId(java.lang.String)` to initialise a WatchFaceId for these watch faces.

<br />

| Parameters ||
|---|---|
| `packageName` | `String`: The package name of the watch face represented by this WatchFaceId. <br /> |
| `className` | `String`: The class name of the watch face service corresponding to this WatchFaceId. <br /> |

## Public methods

### equals

Added in [version 35.1](https://developer.android.com/topic/libraries/support-library/revisions)

```
public boolean equals (Object o)
```

<br />

<br />

| Parameters ||
|---|---|
| `o` | `Object` <br /> |

| Returns ||
|---|---|
| `boolean` | <br /> |

### getClassName

Added in [version 35.1](https://developer.android.com/topic/libraries/support-library/revisions)

```
public String getClassName ()
```

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

<br />

| Returns ||
|---|---|
| `String` | <br /> |

### getPackageName

Added in [version 35.1](https://developer.android.com/topic/libraries/support-library/revisions)

```
public String getPackageName ()
```

Returns the app package name which contains this watch face.

<br />

| Returns ||
|---|---|
| `String` | <br /> |

### hashCode

Added in [version 35.1](https://developer.android.com/topic/libraries/support-library/revisions)

```
public int hashCode ()
```

<br />

<br />

| Returns ||
|---|---|
| `int` | <br /> |

### toString

Added in [version 35.1](https://developer.android.com/topic/libraries/support-library/revisions)

```
public String toString ()
```

<br />

<br />

| Returns ||
|---|---|
| `String` | <br /> |