Added in [version 33.1](https://developer.android.com/topic/libraries/support-library/revisions) Summary: [Nested Classes](https://developer.android.com/reference/com/google/wear/Sdk#nestedclasses) \| [Constants](https://developer.android.com/reference/com/google/wear/Sdk#constants) \| [Methods](https://developer.android.com/reference/com/google/wear/Sdk#pubmethods) \| [Inherited Methods](https://developer.android.com/reference/com/google/wear/Sdk#inhmethods)

# Sdk


`
public

final

class
Sdk
`


`

extends Object


`

`


`

|---|---|
| java.lang.Object ||
| ↳ | com.google.wear.Sdk |

<br />

*** ** * ** ***

The Wear SDK provides developers with a new way to access Wear specific platform APIs.

Wear platform updates (and associated API changes) happen more frequently than Android's API
release schedule via platform feature drops - as a result, developers should take note of the
recommended methods which can help determine platform API availability/compatibility - ensuring
that they are always targeting the correct version in their code.

Wear SDK users should make use of the following Android version/feature constructs:

- `android.os.Build.VERSION.SDK_INT` The Wear OS platform is built upon the Android platform. As such, any required checks for platform API level should reference this value. Likewise, any API introduced in a new Android release can be assumed to be present in the Wear OS version built upon the same (only exception being cases where the Android Compatibility Definition Document precludes the availability of APIs/features on watches).
- `Sdk.hasApiFeature(String apiFeature)` Using this method, developers can qualify changes to API that may have occurred *between* Android platform API updates (i.e. `https://developer.android.com/reference/com/google/wear/Sdk.VERSION#isIncrementalRelease()` is `true`) as a platform API feature drop.

When new APIs are added, developers should start by checking the documentation to see which
platform API level or API feature introduced the API. Once a developer has determined the point
of introduction, they can safely check for the availability of the API in their app before trying
to use it so as to ensure compatibility.

Take for example a new API `foo()` which is introduced via the Wear SDK at `Build.VERSION.SDK_INT == 33`. Developers can use the familiar method to check API availability:


```
 public void doFoo() {
     if(Build.VERSION.SDK_INT >= 33) {
         foo();
     } else {
         // pre-foo compat
     }
 }
```

<br />

## Summary

| ### Nested classes ||
|---|---|
| ` class` | `https://developer.android.com/reference/com/google/wear/Sdk.VERSION` Version constants for Wear SDK used to determine API availability/compatibility. |
| ` class` | `https://developer.android.com/reference/com/google/wear/Sdk.VERSION_CODES` The set of known Wear SDK version codes: - `https://developer.android.com/reference/com/google/wear/Sdk.VERSION_CODES#WEAR_TIRAMISU_1` - `https://developer.android.com/reference/com/google/wear/Sdk.VERSION_CODES#WEAR_TIRAMISU_2` - `https://developer.android.com/reference/com/google/wear/Sdk.VERSION_CODES#WEAR_TIRAMISU_3` - `https://developer.android.com/reference/com/google/wear/Sdk.VERSION_CODES#WEAR_TIRAMISU_4` - `https://developer.android.com/reference/com/google/wear/Sdk.VERSION_CODES#WEAR_UDC_1` - `https://developer.android.com/reference/com/google/wear/Sdk.VERSION_CODES#WEAR_VIC_1` - `https://developer.android.com/reference/com/google/wear/Sdk.VERSION_CODES#WEAR_BAKLAVA_0` - `https://developer.android.com/reference/com/google/wear/Sdk.VERSION_CODES#WEAR_BAKLAVA_1` - `https://developer.android.com/reference/com/google/wear/Sdk.VERSION_CODES#WEAR_CINNAMON_BUN_0` <br /> |

| ### Constants ||
|---|---|
| `String` | `https://developer.android.com/reference/com/google/wear/Sdk#FEATURE_WEAR_GESTURE_DETECTION` Feature indicating support for detecting user gestures like One Handed Gestures. |
| `String` | `https://developer.android.com/reference/com/google/wear/Sdk#FEATURE_WEAR_MATERIAL_3` Feature indicating support for the Material 3 design system on Wear. |
| `String` | `https://developer.android.com/reference/com/google/wear/Sdk#FEATURE_WEAR_TIRAMISU_QPR1_API` *This constant was deprecated in API level 34.1. use ApiVersion `https://developer.android.com/reference/com/google/wear/Sdk.VERSION_CODES#WEAR_TIRAMISU_1` instead.* |
| `String` | `https://developer.android.com/reference/com/google/wear/Sdk#FEATURE_WEAR_TIRAMISU_QPR2_API` *This constant was deprecated in API level 34.1. use ApiVersion `https://developer.android.com/reference/com/google/wear/Sdk.VERSION_CODES#WEAR_TIRAMISU_2` instead.* |
| `String` | `https://developer.android.com/reference/com/google/wear/Sdk#FEATURE_WEAR_TIRAMISU_QPR3_API` *This constant was deprecated in API level 34.1. use ApiVersion `https://developer.android.com/reference/com/google/wear/Sdk.VERSION_CODES#WEAR_TIRAMISU_3` instead.* |
| `String` | `https://developer.android.com/reference/com/google/wear/Sdk#FEATURE_WEAR_TIRAMISU_QPR4_API` *This constant was deprecated in API level 34.1. use ApiVersion `https://developer.android.com/reference/com/google/wear/Sdk.VERSION_CODES#WEAR_TIRAMISU_4` instead.* |

| ### Public methods ||
|---|---|
| ` static <T> T` | ` https://developer.android.com/reference/com/google/wear/Sdk#getWearManager(android.content.Context,%20java.lang.Class<T>)(Context context, Class<T> managerClazz) ` Get a specific Wear service manager for a given service by name, similar to `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.Class<T>)` )}. |
| ` static <T> T` | ` https://developer.android.com/reference/com/google/wear/Sdk#getWearManager(java.lang.Class<T>)(Class<T> managerClazz) ` *This method was deprecated in API level 33.3. Use `https://developer.android.com/reference/com/google/wear/Sdk#getWearManager(android.content.Context,%20java.lang.Class<T>)` instead.* |
| ` static boolean` | ` https://developer.android.com/reference/com/google/wear/Sdk#hasApiFeature(java.lang.String)(String apiFeature) ` Check the availability of a given Wear API feature, where features are associated with Wear feature drops - based on incremental platform releases. |
| ` static boolean` | ` https://developer.android.com/reference/com/google/wear/Sdk#isApiVersionAtLeast(com.google.wear.WearApiVersion)(https://developer.android.com/reference/com/google/wear/WearApiVersion requiredWearApiVersion) ` Check whether or not the current Wear API version is equal to or greater than the specified Wear API Version. |

| ### 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() ` | ||

## Constants

### FEATURE_WEAR_GESTURE_DETECTION

Added in [API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final String FEATURE_WEAR_GESTURE_DETECTION
```

Feature indicating support for detecting user gestures like One Handed Gestures.

<br />

Constant Value:

"com.google.wear.feature.GESTURE_DETECTION"


### FEATURE_WEAR_MATERIAL_3

Added in [API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final String FEATURE_WEAR_MATERIAL_3
```

Feature indicating support for the Material 3 design system on Wear.

<br />

Constant Value:

"com.google.wear.feature.MATERIAL_3"


### FEATURE_WEAR_TIRAMISU_QPR1_API

Added in [version 33.2](https://developer.android.com/topic/libraries/support-library/revisions)   
Deprecated in [API level
34.1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final String FEATURE_WEAR_TIRAMISU_QPR1_API
```


**This constant was deprecated
in API level 34.1.**   

use ApiVersion `https://developer.android.com/reference/com/google/wear/Sdk.VERSION_CODES#WEAR_TIRAMISU_1` instead.

The first Wear API quarterly release based on the Android T platform (API level 33).

<br />

Constant Value:

"com.google.wear.api.T_QPR1"


### FEATURE_WEAR_TIRAMISU_QPR2_API

Added in [version 33.2](https://developer.android.com/topic/libraries/support-library/revisions)   
Deprecated in [API level
34.1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final String FEATURE_WEAR_TIRAMISU_QPR2_API
```


**This constant was deprecated
in API level 34.1.**   

use ApiVersion `https://developer.android.com/reference/com/google/wear/Sdk.VERSION_CODES#WEAR_TIRAMISU_2` instead.

The second Wear API quarterly release based on the Android T platform (API level 33).

<br />

Constant Value:

"com.google.wear.api.T_QPR2"


### FEATURE_WEAR_TIRAMISU_QPR3_API

Added in [version 33.3](https://developer.android.com/topic/libraries/support-library/revisions)   
Deprecated in [API level
34.1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final String FEATURE_WEAR_TIRAMISU_QPR3_API
```


**This constant was deprecated
in API level 34.1.**   

use ApiVersion `https://developer.android.com/reference/com/google/wear/Sdk.VERSION_CODES#WEAR_TIRAMISU_3` instead.

The third Wear API quarterly release based on the Android T platform (API level 33).

<br />

Constant Value:

"com.google.wear.api.T_QPR3"


### FEATURE_WEAR_TIRAMISU_QPR4_API

Added in [version 33.4](https://developer.android.com/topic/libraries/support-library/revisions)   
Deprecated in [API level
34.1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final String FEATURE_WEAR_TIRAMISU_QPR4_API
```


**This constant was deprecated
in API level 34.1.**   

use ApiVersion `https://developer.android.com/reference/com/google/wear/Sdk.VERSION_CODES#WEAR_TIRAMISU_4` instead.

The fourth Wear API quarterly release based on the Android T platform (API level 33).

<br />

Constant Value:

"com.google.wear.api.T_QPR4"


## Public methods

### getWearManager

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

```
public static T getWearManager (Context context, 
                Class<T> managerClazz)
```

Get a specific Wear service manager for a given service by name, similar to `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.Class<T>)` )}. For example:

```
     AmbientManager ambientManager = Sdk.getWearManager(context, AmbientManager.class);
 
```

<br />

<br />

| Parameters ||
|---|---|
| `context` | `Context`: any context from the calling app. <br /> |
| `managerClazz` | `Class`: the class for the manager being requested e.g. `AmbientManager.class`. <br /> |

| Returns ||
|---|---|
| `T` | the corresponding Wear service manager or null if the service could not be found. <br /> |

### getWearManager

Added in [version 33.2](https://developer.android.com/topic/libraries/support-library/revisions)   
Deprecated in [API level
33.3](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static T getWearManager (Class<T> managerClazz)
```


**This method was deprecated
in API level 33.3.**   

Use `https://developer.android.com/reference/com/google/wear/Sdk#getWearManager(android.content.Context,%20java.lang.Class<T>)` instead.

Get a specific Wear service manager for a given service by name, similar to `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.Class<T>)`. For example:

```
     AmbientManager ambientManager = Sdk.getWearManager(AmbientManager.class);
 
```

<br />

<br />

| Parameters ||
|---|---|
| `managerClazz` | `Class`: the class for the manager being requested e.g. `AmbientManager.class`. <br /> |

| Returns ||
|---|---|
| `T` | the corresponding Wear service manager or null if the service could not be found. <br /> |

### hasApiFeature

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

```
public static boolean hasApiFeature (String apiFeature)
```

Check the availability of a given Wear API feature, where features are associated with Wear
feature drops - based on incremental platform releases.

Clients can use @RequiresFeature(name = \<apiFeature name\>, enforcement =
"com.google.wear.Sdk#hasApiFeature") to ensure that their code checks required API
compatibility/availability.

Note: This API is intended only for use with granular system features provided via the
Wear SDK. clients checking an overall API level should use `https://developer.android.com/reference/com/google/wear/Sdk#isApiVersionAtLeast(com.google.wear.WearApiVersion)` to qualify based on a release.

<br />

| Parameters ||
|---|---|
| `apiFeature` | `String`: the required API feature to check using the pre-defined constants provided by the SDK. Value is one of the following: - `https://developer.android.com/reference/com/google/wear/Sdk#FEATURE_WEAR_TIRAMISU_QPR1_API` - `https://developer.android.com/reference/com/google/wear/Sdk#FEATURE_WEAR_TIRAMISU_QPR2_API` - `https://developer.android.com/reference/com/google/wear/Sdk#FEATURE_WEAR_TIRAMISU_QPR3_API` - `https://developer.android.com/reference/com/google/wear/Sdk#FEATURE_WEAR_TIRAMISU_QPR4_API` - `https://developer.android.com/reference/com/google/wear/Sdk#FEATURE_WEAR_MATERIAL_3` - `https://developer.android.com/reference/com/google/wear/Sdk#FEATURE_WEAR_GESTURE_DETECTION` |

| Returns ||
|---|---|
| `boolean` | true if the system includes \& supports the required feature, otherwise false. <br /> |

### isApiVersionAtLeast

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

```
public static boolean isApiVersionAtLeast (WearApiVersion requiredWearApiVersion)
```

Check whether or not the current Wear API version is equal to or greater than the specified
Wear API Version. Note Wear API versions are predefined constants, provided by the Wear SDK
`https://developer.android.com/reference/com/google/wear/Sdk.VERSION_CODES`.

<br />

| Parameters ||
|---|---|
| `requiredWearApiVersion` | `WearApiVersion`: the Wear API version required by the caller, to be checked against the current Wear API version. <br /> |

| Returns ||
|---|---|
| `boolean` | true if the current Wear API version is equal to or greater than the required API version, otherwise false. <br /> |