# WearableCalendarContract

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

*** ** * ** ***


```
public class WearableCalendarContract
```

<br />

*** ** * ** ***

The contract between the wearable calendar provider and applications. This API provides a subset of the data available through `https://developer.android.com/reference/android/provider/CalendarContract.html`, but is automatically synced to wearable devices.

## Summary

| ### Nested types |
|---|
| `public final class https://developer.android.com/reference/androidx/wear/provider/WearableCalendarContract.Attendees` |
| `public final class https://developer.android.com/reference/androidx/wear/provider/WearableCalendarContract.Instances` |
| `public final class https://developer.android.com/reference/androidx/wear/provider/WearableCalendarContract.Reminders` |

| ### Constants |
|---|---|
| `static final @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/net/Uri.html` | `https://developer.android.com/reference/androidx/wear/provider/WearableCalendarContract#CONTENT_URI()` The content:// style URL for the top-level wearable calendar authority. |

| ### Public methods |
|---|---|
| `static void` | `https://developer.android.com/reference/androidx/wear/provider/WearableCalendarContract#addCalendarAuthorityUri(android.content.UriMatcher,java.lang.String,int)( @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/content/UriMatcher.html uriMatcher, @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/String.html path, int code )` Adds uri to match to the given `https://developer.android.com/reference/android/content/UriMatcher.html` with calendar authority, `https://developer.android.com/reference/java/lang/String.html` path and the integer code to return when this Uri is matched. |
| `static void` | `https://developer.android.com/reference/androidx/wear/provider/WearableCalendarContract#addCalendarDataAuthority(android.content.IntentFilter,java.lang.String)( @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/content/IntentFilter.html intentFilter, @https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/java/lang/String.html port )` Adds new `https://developer.android.com/reference/android/content/Intent.html` to the given `https://developer.android.com/reference/android/content/IntentFilter.html` with calendar data authority and `https://developer.android.com/reference/java/lang/String.html` host to match. |

## Constants

### CONTENT_URI

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

```
public static final @NonNull Uri CONTENT_URI
```

The content:// style URL for the top-level wearable calendar authority.

## Public methods

### addCalendarAuthorityUri

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

```
public static void addCalendarAuthorityUri(
    @NonNull UriMatcher uriMatcher,
    @NonNull String path,
    int code
)
```

Adds uri to match to the given `https://developer.android.com/reference/android/content/UriMatcher.html` with calendar authority, `https://developer.android.com/reference/java/lang/String.html` path and the integer code to return when this Uri is matched.

| Parameters |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/content/UriMatcher.html uriMatcher` | The UriMatcher holding matches. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/String.html path` | The path to match in calendar authority. \* may be used as a wild card for any text, and # may be used as a wild card for numbers. |
| `int code` | The code that is returned when a Uri is matched against the calendar authority and path. Must be positive. |

### addCalendarDataAuthority

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

```
public static void addCalendarDataAuthority(
    @NonNull IntentFilter intentFilter,
    @Nullable String port
)
```

Adds new `https://developer.android.com/reference/android/content/Intent.html` to the given `https://developer.android.com/reference/android/content/IntentFilter.html` with calendar data authority and `https://developer.android.com/reference/java/lang/String.html` host to match.

| Parameters |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/content/IntentFilter.html intentFilter` | The IntentFilter holding matches. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/java/lang/String.html port` | Optional port part of the authority to match. If null, any port is allowed. |