# WearableCalendarContract

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

*** ** * ** ***

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

<br />

```
class WearableCalendarContract
```

<br />

*** ** * ** ***

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

## Summary

|                                                                    ### Nested types                                                                    |
|--------------------------------------------------------------------------------------------------------------------------------------------------------|
| `class `[WearableCalendarContract.Attendees](https://developer.android.com/reference/kotlin/androidx/wear/provider/WearableCalendarContract.Attendees) |
| `class `[WearableCalendarContract.Instances](https://developer.android.com/reference/kotlin/androidx/wear/provider/WearableCalendarContract.Instances) |
| `class `[WearableCalendarContract.Reminders](https://developer.android.com/reference/kotlin/androidx/wear/provider/WearableCalendarContract.Reminders) |

|                                ### Constants                                |
|-----------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `const `[Uri](https://developer.android.com/reference/android/net/Uri.html) | [CONTENT_URI](https://developer.android.com/reference/kotlin/androidx/wear/provider/WearableCalendarContract#CONTENT_URI()) The content:// style URL for the top-level wearable calendar authority. |

|                                    ### Public functions                                     |
|---------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `java-static `[Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html) | [addCalendarAuthorityUri](https://developer.android.com/reference/kotlin/androidx/wear/provider/WearableCalendarContract#addCalendarAuthorityUri(android.content.UriMatcher,java.lang.String,int))`(uriMatcher: `[UriMatcher](https://developer.android.com/reference/android/content/UriMatcher.html)`, path: `[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)`, code: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`)` Adds uri to match to the given[UriMatcher](https://developer.android.com/reference/android/content/UriMatcher.html)with calendar authority,[String](https://developer.android.com/reference/java/lang/String.html)path and the integer code to return when this Uri is matched. |
| `java-static `[Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html) | [addCalendarDataAuthority](https://developer.android.com/reference/kotlin/androidx/wear/provider/WearableCalendarContract#addCalendarDataAuthority(android.content.IntentFilter,java.lang.String))`(intentFilter: `[IntentFilter](https://developer.android.com/reference/android/content/IntentFilter.html)`, port: `[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)`?)` Adds new[android.content.Intent](https://developer.android.com/reference/android/content/Intent.html)to the given[IntentFilter](https://developer.android.com/reference/android/content/IntentFilter.html)with calendar data authority and[String](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)  

```
const val CONTENT_URI: Uri
```

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

## Public functions

### addCalendarAuthorityUri

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

```
java-static fun addCalendarAuthorityUri(uriMatcher: UriMatcher, path: String, code: Int): Unit
```

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

|                                             Parameters                                              |
|-----------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------|
| `uriMatcher: `[UriMatcher](https://developer.android.com/reference/android/content/UriMatcher.html) | The UriMatcher holding matches.                                                                                                    |
| `path: `[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)           | 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. |
| `code: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)                 | 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)  

```
java-static fun addCalendarDataAuthority(intentFilter: IntentFilter, port: String?): Unit
```

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

|                                                Parameters                                                 |
|-----------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------|
| `intentFilter: `[IntentFilter](https://developer.android.com/reference/android/content/IntentFilter.html) | The IntentFilter holding matches.                                           |
| `port: `[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)`?`              | Optional port part of the authority to match. If null, any port is allowed. |