# MetadataConstants

# MetadataConstants

Artifact:[androidx.wear:wear](https://developer.android.com/jetpack/androidx/releases/wear)  
[View Source](https://cs.android.com/search?q=file:androidx/wear/utils/MetadataConstants.java+class:androidx.wear.utils.MetadataConstants)  
Added in[1.1.0](https://developer.android.com/jetpack/androidx/releases/wear#1.1.0)

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/androidx/wear/utils/MetadataConstants "View this page in Java")

<br />

```
class MetadataConstants
```

<br />

*** ** * ** ***

Constants for android wear apps which are related to manifest meta-data.

## Summary

|                                        ### Constants                                         |
|----------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `const `[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)`!` | [NOTIFICATION_BRIDGE_MODE_BRIDGING](https://developer.android.com/reference/kotlin/androidx/wear/utils/MetadataConstants#NOTIFICATION_BRIDGE_MODE_BRIDGING())` = "BRIDGING"` The value of the notification bridge mode meta-data element in the case where the Wear app wants notifications to be bridged from the phone to the wearable.                                              |
| `const `[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)`!` | [NOTIFICATION_BRIDGE_MODE_METADATA_NAME](https://developer.android.com/reference/kotlin/androidx/wear/utils/MetadataConstants#NOTIFICATION_BRIDGE_MODE_METADATA_NAME())` = "com.google.android.wearable.notificationBridgeMode"` We support specifying whether notifications should be bridged from the phone to the wearable in the Wear app manifest file.                           |
| `const `[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)`!` | [NOTIFICATION_BRIDGE_MODE_NO_BRIDGING](https://developer.android.com/reference/kotlin/androidx/wear/utils/MetadataConstants#NOTIFICATION_BRIDGE_MODE_NO_BRIDGING())` = "NO_BRIDGING"` The value of the notification bridge mode meta-data element in the case where the Wear app does not want notifications to be bridged from the phone to the wearable.                             |
| `const `[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)`!` | [STANDALONE_METADATA_NAME](https://developer.android.com/reference/kotlin/androidx/wear/utils/MetadataConstants#STANDALONE_METADATA_NAME())` = "com.google.android.wearable.standalone"` The name of the meta-data element in the Wear app manifest for specifying whether this app does not require a companion phone app.                                                            |
| `const `[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)`!` | [WATCH_FACE_PREVIEW_CIRCULAR_METADATA_NAME](https://developer.android.com/reference/kotlin/androidx/wear/utils/MetadataConstants#WATCH_FACE_PREVIEW_CIRCULAR_METADATA_NAME())` = "com.google.android.wearable.watchface.preview_circular"` The name of the meta-data element in the watch face service manifest declaration used to assign a circular preview image to the watch face. |
| `const `[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)`!` | [WATCH_FACE_PREVIEW_METADATA_NAME](https://developer.android.com/reference/kotlin/androidx/wear/utils/MetadataConstants#WATCH_FACE_PREVIEW_METADATA_NAME())` = "com.google.android.wearable.watchface.preview"` The name of the meta-data element in the watch face service manifest declaration used to assign a non-circular preview image to the watch face.                        |

|                                       ### Public functions                                        |
|---------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `java-static `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)         | [getPreviewDrawableResourceId](https://developer.android.com/reference/kotlin/androidx/wear/utils/MetadataConstants#getPreviewDrawableResourceId(android.content.Context,boolean))`(context: `[Context](https://developer.android.com/reference/android/content/Context.html)`!, circular: `[Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)`)` |
| `java-static `[Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) | [isNotificationBridgingEnabled](https://developer.android.com/reference/kotlin/androidx/wear/utils/MetadataConstants#isNotificationBridgingEnabled(android.content.Context))`(context: `[Context](https://developer.android.com/reference/android/content/Context.html)`!)` Determines whether a given context has notification bridging enabled.                                  |
| `java-static `[Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) | [isStandalone](https://developer.android.com/reference/kotlin/androidx/wear/utils/MetadataConstants#isStandalone(android.content.Context))`(context: `[Context](https://developer.android.com/reference/android/content/Context.html)`!)` Determines whether a given context comes from a standalone app.                                                                          |

## Constants

### NOTIFICATION_BRIDGE_MODE_BRIDGING

Added in[1.1.0](https://developer.android.com/jetpack/androidx/releases/wear#1.1.0)  

```
const val NOTIFICATION_BRIDGE_MODE_BRIDGING = "BRIDGING": String!
```

The value of the notification bridge mode meta-data element in the case where the Wear app wants notifications to be bridged from the phone to the wearable.  

### NOTIFICATION_BRIDGE_MODE_METADATA_NAME

Added in[1.1.0](https://developer.android.com/jetpack/androidx/releases/wear#1.1.0)  

```
const val NOTIFICATION_BRIDGE_MODE_METADATA_NAME = "com.google.android.wearable.notificationBridgeMode": String!
```

We support specifying whether notifications should be bridged from the phone to the wearable in the Wear app manifest file. Simply add a meta-data element to the Wear app manifest with the name "com.google.android.wearable.notificationBridgeMode" and either the value NO_BRIDGING or the value BRIDGING. If you choose not to update your Wear app manifest, then notifications will be bridged by default from the phone to the wearable.

NO_BRIDGING means that phone notifications will not be bridged to the wearable if the wearable app is installed.

BRIDGING means that phone notifications will be bridged to the wearable, unless they are posted with[setLocalOnly(true)](https://developer.android.com/reference/android/app/Notification.Builder.html#setLocalOnly(boolean)).

Example AndroidManifest.xml meta-data element for NO_BRIDGING:  

```kotlin
<meta-data
    android:name="com.google.android.wearable.notificationBridgeMode"
    android:value="NO_BRIDGING" />
```

Example AndroidManifest.xml meta-data element for BRIDGING:  

```kotlin
<meta-data
    android:name="com.google.android.wearable.notificationBridgeMode"
    android:value="BRIDGING" />
```  

### NOTIFICATION_BRIDGE_MODE_NO_BRIDGING

Added in[1.1.0](https://developer.android.com/jetpack/androidx/releases/wear#1.1.0)  

```
const val NOTIFICATION_BRIDGE_MODE_NO_BRIDGING = "NO_BRIDGING": String!
```

The value of the notification bridge mode meta-data element in the case where the Wear app does not want notifications to be bridged from the phone to the wearable.  

### STANDALONE_METADATA_NAME

Added in[1.1.0](https://developer.android.com/jetpack/androidx/releases/wear#1.1.0)  

```
const val STANDALONE_METADATA_NAME = "com.google.android.wearable.standalone": String!
```

The name of the meta-data element in the Wear app manifest for specifying whether this app does not require a companion phone app. The value should be set to "true" or "false".

Wear apps that do not require a phone side companion app to function can declare this in their AndroidManifest.xml file by setting the standalone meta-data element to true as shown in the following example. If this value is true, all users can discover this app regardless of what phone they have. If this value is false (or not set), only users with compatible Android phones can discover this app.  

```kotlin
<meta-data
android:name="com.google.android.wearable.standalone"
android:value="true" />
```  

### WATCH_FACE_PREVIEW_CIRCULAR_METADATA_NAME

Added in[1.1.0](https://developer.android.com/jetpack/androidx/releases/wear#1.1.0)  

```
const val WATCH_FACE_PREVIEW_CIRCULAR_METADATA_NAME = "com.google.android.wearable.watchface.preview_circular": String!
```

The name of the meta-data element in the watch face service manifest declaration used to assign a circular preview image to the watch face. The value should be set to a drawable reference.  

```kotlin
<meta-data
    android:name="com.google.android.wearable.watchface.preview_circular"
    android:resource="@drawable/preview_face_circular" />
```  

### WATCH_FACE_PREVIEW_METADATA_NAME

Added in[1.1.0](https://developer.android.com/jetpack/androidx/releases/wear#1.1.0)  

```
const val WATCH_FACE_PREVIEW_METADATA_NAME = "com.google.android.wearable.watchface.preview": String!
```

The name of the meta-data element in the watch face service manifest declaration used to assign a non-circular preview image to the watch face. The value should be set to a drawable reference.  

```kotlin
<meta-data
    android:name="com.google.android.wearable.watchface.preview"
    android:resource="@drawable/preview_face" />
```  

## Public functions

### getPreviewDrawableResourceId

Added in[1.1.0](https://developer.android.com/jetpack/androidx/releases/wear#1.1.0)  

```
java-static fun getPreviewDrawableResourceId(context: Context!, circular: Boolean): Int
```  

|                                           Parameters                                            |
|-------------------------------------------------------------------------------------------------|----------------------------------------------------|
| `context: `[Context](https://developer.android.com/reference/android/content/Context.html)`!`   | to be evaluated.                                   |
| `circular: `[Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) | Whether to return the circular or regular preview. |

|                                   Returns                                   |
|-----------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------|
| [Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | an integer id representing the resource id of the requested drawable, or 0 if no drawable was found. |

### isNotificationBridgingEnabled

Added in[1.1.0](https://developer.android.com/jetpack/androidx/releases/wear#1.1.0)  

```
java-static fun isNotificationBridgingEnabled(context: Context!): Boolean
```

Determines whether a given context has notification bridging enabled.  

|                                          Parameters                                           |
|-----------------------------------------------------------------------------------------------|------------------|
| `context: `[Context](https://developer.android.com/reference/android/content/Context.html)`!` | to be evaluated. |

|                                       Returns                                       |
|-------------------------------------------------------------------------------------|------------------------------------------------------------|
| [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) | Whether a given context has notification bridging enabled. |

### isStandalone

Added in[1.1.0](https://developer.android.com/jetpack/androidx/releases/wear#1.1.0)  

```
java-static fun isStandalone(context: Context!): Boolean
```

Determines whether a given context comes from a standalone app. This can be used as a proxy to check if any given app is compatible with iOS Companion devices.  

|                                          Parameters                                           |
|-----------------------------------------------------------------------------------------------|------------------|
| `context: `[Context](https://developer.android.com/reference/android/content/Context.html)`!` | to be evaluated. |

|                                       Returns                                       |
|-------------------------------------------------------------------------------------|------------------------------------------------------|
| [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) | Whether a given context comes from a standalone app. |