# CreateEntry.Builder

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

*** ** * ** ***

<br />

```
class CreateEntry.Builder
```

<br />

*** ** * ** ***

A builder for `https://developer.android.com/reference/kotlin/androidx/credentials/provider/CreateEntry`

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/kotlin/androidx/credentials/provider/CreateEntry.Builder#Builder(kotlin.CharSequence,android.app.PendingIntent)(accountName: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-char-sequence/index.html, pendingIntent: https://developer.android.com/reference/android/app/PendingIntent.html)` constructs an instance of `https://developer.android.com/reference/kotlin/androidx/credentials/provider/CreateEntry.Builder` |

| ### Public functions |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/credentials/provider/CreateEntry` | `https://developer.android.com/reference/kotlin/androidx/credentials/provider/CreateEntry.Builder#build()()` Builds an instance of `https://developer.android.com/reference/kotlin/androidx/credentials/provider/CreateEntry` |
| `https://developer.android.com/reference/kotlin/androidx/credentials/provider/CreateEntry.Builder` | `https://developer.android.com/reference/kotlin/androidx/credentials/provider/CreateEntry.Builder#setAutoSelectAllowed(kotlin.Boolean)(autoSelectAllowed: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)` Sets whether the entry should be auto-selected. |
| `https://developer.android.com/reference/kotlin/androidx/credentials/provider/CreateEntry.Builder` | `@https://developer.android.com/reference/kotlin/androidx/annotation/RequiresApi(value = 35) https://developer.android.com/reference/kotlin/androidx/credentials/provider/CreateEntry.Builder#setBiometricPromptData(androidx.credentials.provider.BiometricPromptData)(biometricPromptData: https://developer.android.com/reference/kotlin/androidx/credentials/provider/BiometricPromptData?)` Sets the biometric prompt data to optionally utilize a credential manager flow that directly handles the biometric verification for you and gives you the response; set to null by default, indicating the default behavior is to not utilize this embedded biometric prompt flow. |
| `https://developer.android.com/reference/kotlin/androidx/credentials/provider/CreateEntry.Builder` | `https://developer.android.com/reference/kotlin/androidx/credentials/provider/CreateEntry.Builder#setDescription(kotlin.CharSequence)(description: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-char-sequence/index.html?)` Sets a localized description to be displayed on the UI at the time of credential creation. |
| `https://developer.android.com/reference/kotlin/androidx/credentials/provider/CreateEntry.Builder` | `https://developer.android.com/reference/kotlin/androidx/credentials/provider/CreateEntry.Builder#setIcon(android.graphics.drawable.Icon)(icon: https://developer.android.com/reference/android/graphics/drawable/Icon.html?)` Sets an icon to be displayed with the entry on the UI |
| `https://developer.android.com/reference/kotlin/androidx/credentials/provider/CreateEntry.Builder` | `https://developer.android.com/reference/kotlin/androidx/credentials/provider/CreateEntry.Builder#setLastUsedTime(java.time.Instant)(lastUsedTime: https://developer.android.com/reference/java/time/Instant.html?)` Sets the last time this account was used |
| `https://developer.android.com/reference/kotlin/androidx/credentials/provider/CreateEntry.Builder` | `https://developer.android.com/reference/kotlin/androidx/credentials/provider/CreateEntry.Builder#setPasswordCredentialCount(kotlin.Int)(count: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` Sets the password credential count, denoting how many credentials of type `https://developer.android.com/reference/kotlin/androidx/credentials/PasswordCredential#TYPE_PASSWORD_CREDENTIAL()` does the provider have stored. |
| `https://developer.android.com/reference/kotlin/androidx/credentials/provider/CreateEntry.Builder` | `https://developer.android.com/reference/kotlin/androidx/credentials/provider/CreateEntry.Builder#setPublicKeyCredentialCount(kotlin.Int)(count: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` Sets the password credential count, denoting how many credentials of type `https://developer.android.com/reference/kotlin/androidx/credentials/PublicKeyCredential#TYPE_PUBLIC_KEY_CREDENTIAL()` does the provider have stored. |
| `https://developer.android.com/reference/kotlin/androidx/credentials/provider/CreateEntry.Builder` | `https://developer.android.com/reference/kotlin/androidx/credentials/provider/CreateEntry.Builder#setTotalCredentialCount(kotlin.Int)(count: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` Sets the total credential count, denoting how many credentials in total does the provider have stored. |

## Public constructors

### Builder

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

```
Builder(accountName: CharSequence, pendingIntent: PendingIntent)
```

constructs an instance of `https://developer.android.com/reference/kotlin/androidx/credentials/provider/CreateEntry.Builder`

| Parameters |
|---|---|
| `accountName: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-char-sequence/index.html` | the name of the account where the credential will be registered |
| `pendingIntent: https://developer.android.com/reference/android/app/PendingIntent.html` | the `https://developer.android.com/reference/android/app/PendingIntent.html` that will get invoked when the user selects this entry, must be created with a unique request code per entry, with flag `https://developer.android.com/reference/android/app/PendingIntent.html#FLAG_MUTABLE` to allow the Android system to attach the final request, and NOT with flag `https://developer.android.com/reference/android/app/PendingIntent.html#FLAG_ONE_SHOT` as it can be invoked multiple times |

## Public functions

### build

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

```
fun build(): CreateEntry
```

Builds an instance of `https://developer.android.com/reference/kotlin/androidx/credentials/provider/CreateEntry`

| Throws |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-illegal-argument-exception/index.html` | If `https://developer.android.com/reference/kotlin/androidx/credentials/provider/CreateEntry.Builder#accountName()` is empty |

### setAutoSelectAllowed

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

```
fun setAutoSelectAllowed(autoSelectAllowed: Boolean): CreateEntry.Builder
```

Sets whether the entry should be auto-selected. The value is false by default.

### setBiometricPromptData

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

```
@RequiresApi(value = 35)
fun setBiometricPromptData(biometricPromptData: BiometricPromptData?): CreateEntry.Builder
```

Sets the biometric prompt data to optionally utilize a credential manager flow that directly handles the biometric verification for you and gives you the response; set to null by default, indicating the default behavior is to not utilize this embedded biometric prompt flow.

### setDescription

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

```
fun setDescription(description: CharSequence?): CreateEntry.Builder
```

Sets a localized description to be displayed on the UI at the time of credential creation.

Typically this description should contain information informing the user of the credential being created, and where it is being stored. Providers are free to phrase this however they see fit.

| Throws |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-illegal-argument-exception/index.html` | if `https://developer.android.com/reference/kotlin/androidx/credentials/provider/CreateEntry.Builder#setDescription(kotlin.CharSequence)` is longer than 300 characters ( important: make sure your descriptions across all locales are within this limit). |

### setIcon

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

```
fun setIcon(icon: Icon?): CreateEntry.Builder
```

Sets an icon to be displayed with the entry on the UI

### setLastUsedTime

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

```
fun setLastUsedTime(lastUsedTime: Instant?): CreateEntry.Builder
```

Sets the last time this account was used

### setPasswordCredentialCount

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

```
fun setPasswordCredentialCount(count: Int): CreateEntry.Builder
```

Sets the password credential count, denoting how many credentials of type `https://developer.android.com/reference/kotlin/androidx/credentials/PasswordCredential#TYPE_PASSWORD_CREDENTIAL()` does the provider have stored.

This information will be displayed on the `https://developer.android.com/reference/kotlin/androidx/credentials/provider/CreateEntry` to help the user make a choice.

### setPublicKeyCredentialCount

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

```
fun setPublicKeyCredentialCount(count: Int): CreateEntry.Builder
```

Sets the password credential count, denoting how many credentials of type `https://developer.android.com/reference/kotlin/androidx/credentials/PublicKeyCredential#TYPE_PUBLIC_KEY_CREDENTIAL()` does the provider have stored.

This information will be displayed on the `https://developer.android.com/reference/kotlin/androidx/credentials/provider/CreateEntry` to help the user make a choice.

### setTotalCredentialCount

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

```
fun setTotalCredentialCount(count: Int): CreateEntry.Builder
```

Sets the total credential count, denoting how many credentials in total does the provider have stored.

This total count no. does not need to be a total of the counts set through `https://developer.android.com/reference/kotlin/androidx/credentials/provider/CreateEntry.Builder#setPasswordCredentialCount(kotlin.Int)` and `https://developer.android.com/reference/kotlin/androidx/credentials/provider/CreateEntry.Builder#setPublicKeyCredentialCount(kotlin.Int)`.

This information will be displayed on the `https://developer.android.com/reference/kotlin/androidx/credentials/provider/CreateEntry` to help the user make a choice.