# InputSignInMethod

Artifact: [androidx.car.app:app](https://developer.android.com/jetpack/androidx/releases/car-app) [View Source](https://cs.android.com/search?q=file:androidx/car/app/model/signin/InputSignInMethod.java+class:androidx.car.app.model.signin.InputSignInMethod) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/car-app#1.0.0)

*** ** * ** ***


```
@RequiresCarApi(value = 2)
@CarProtocol
public final class InputSignInMethod implements SignInTemplate.SignInMethod
```

<br />

*** ** * ** ***

A `https://developer.android.com/reference/androidx/car/app/model/signin/SignInTemplate.SignInMethod` that presents an input box for the user to enter their credentials.

For example, this can be used to request a username, a password or an activation code.

## Summary

| ### Nested types |
|---|
| `public final class https://developer.android.com/reference/androidx/car/app/model/signin/InputSignInMethod.Builder` A builder of `https://developer.android.com/reference/androidx/car/app/model/signin/InputSignInMethod`. |

| ### Constants |
|---|---|
| `static final int` | `https://developer.android.com/reference/androidx/car/app/model/signin/InputSignInMethod#INPUT_TYPE_DEFAULT() = 1` Default input where the text is shown as it is typed. |
| `static final int` | `https://developer.android.com/reference/androidx/car/app/model/signin/InputSignInMethod#INPUT_TYPE_PASSWORD() = 2` Input where the text is hidden as it is typed. |
| `static final int` | `https://developer.android.com/reference/androidx/car/app/model/signin/InputSignInMethod#KEYBOARD_DEFAULT() = 1` Default (full) keyboard. |
| `static final int` | `https://developer.android.com/reference/androidx/car/app/model/signin/InputSignInMethod#KEYBOARD_EMAIL() = 2` Keyboard optimized for typing an email address. |
| `static final int` | `https://developer.android.com/reference/androidx/car/app/model/signin/InputSignInMethod#KEYBOARD_NUMBER() = 4` Keyboard optimized for typing numbers. |
| `static final int` | `https://developer.android.com/reference/androidx/car/app/model/signin/InputSignInMethod#KEYBOARD_PHONE() = 3` Keyboard optimized for typing a phone number. |

| ### Public methods |
|---|---|
| `boolean` | `https://developer.android.com/reference/androidx/car/app/model/signin/InputSignInMethod#equals(java.lang.Object)(https://developer.android.com/reference/java/lang/Object.html other)` |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/androidx/car/app/model/CarText` | `https://developer.android.com/reference/androidx/car/app/model/signin/InputSignInMethod#getDefaultValue()()` Returns the default value for this input box or `null` if no value is provided. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/androidx/car/app/model/CarText` | `https://developer.android.com/reference/androidx/car/app/model/signin/InputSignInMethod#getErrorMessage()()` Returns an error message associated with the user input. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/androidx/car/app/model/CarText` | `https://developer.android.com/reference/androidx/car/app/model/signin/InputSignInMethod#getHint()()` Returns the text explaining to the user what should be entered in this input box or `null` if no hint is provided. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/car/app/model/InputCallbackDelegate` | `https://developer.android.com/reference/androidx/car/app/model/signin/InputSignInMethod#getInputCallbackDelegate()()` Returns the `https://developer.android.com/reference/androidx/car/app/model/InputCallbackDelegate` for input callbacks. |
| `int` | `https://developer.android.com/reference/androidx/car/app/model/signin/InputSignInMethod#getInputType()()` Returns the input type, one of `https://developer.android.com/reference/androidx/car/app/model/signin/InputSignInMethod#INPUT_TYPE_DEFAULT()` or `https://developer.android.com/reference/androidx/car/app/model/signin/InputSignInMethod#INPUT_TYPE_PASSWORD()` |
| `int` | `https://developer.android.com/reference/androidx/car/app/model/signin/InputSignInMethod#getKeyboardType()()` Returns the type of keyboard to be displayed when this input gets focused. |
| `int` | `https://developer.android.com/reference/androidx/car/app/model/signin/InputSignInMethod#hashCode()()` |
| `boolean` | `https://developer.android.com/reference/androidx/car/app/model/signin/InputSignInMethod#isShowKeyboardByDefault()()` Returns whether to show the keyboard by default or not. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/car/app/model/signin/InputSignInMethod#toString()()` |

## Constants

### INPUT_TYPE_DEFAULT

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/car-app#1.0.0)

```
public static final int INPUT_TYPE_DEFAULT = 1
```

Default input where the text is shown as it is typed.

### INPUT_TYPE_PASSWORD

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/car-app#1.0.0)

```
public static final int INPUT_TYPE_PASSWORD = 2
```

Input where the text is hidden as it is typed.

### KEYBOARD_DEFAULT

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/car-app#1.0.0)

```
public static final int KEYBOARD_DEFAULT = 1
```

Default (full) keyboard.

### KEYBOARD_EMAIL

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/car-app#1.0.0)

```
public static final int KEYBOARD_EMAIL = 2
```

Keyboard optimized for typing an email address.

### KEYBOARD_NUMBER

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/car-app#1.0.0)

```
public static final int KEYBOARD_NUMBER = 4
```

Keyboard optimized for typing numbers.

### KEYBOARD_PHONE

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/car-app#1.0.0)

```
public static final int KEYBOARD_PHONE = 3
```

Keyboard optimized for typing a phone number.

## Public methods

### equals

```
public boolean equals(Object other)
```

### getDefaultValue

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/car-app#1.0.0)

```
public @Nullable CarText getDefaultValue()
```

Returns the default value for this input box or `null` if no value is provided.

For the `https://developer.android.com/reference/androidx/car/app/model/signin/InputSignInMethod#INPUT_TYPE_PASSWORD()` input type, this value will formatted to be hidden to the user as well.

| See also |
|---|---|
| `https://developer.android.com/reference/androidx/car/app/model/signin/InputSignInMethod.Builder#setDefaultValue(java.lang.String)` |   |

### getErrorMessage

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

```
public @Nullable CarText getErrorMessage()
```

Returns an error message associated with the user input.

For example, this can be used to indicate formatting errors, wrong username or password, or any other problem related to the user input.

| See also |
|---|---|
| `https://developer.android.com/reference/androidx/car/app/model/signin/InputSignInMethod.Builder#setErrorMessage(java.lang.CharSequence)` |   |

### getHint

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

```
public @Nullable CarText getHint()
```

Returns the text explaining to the user what should be entered in this input box or `null` if no hint is provided.

| See also |
|---|---|
| `https://developer.android.com/reference/androidx/car/app/model/signin/InputSignInMethod.Builder#setHint(java.lang.CharSequence)` |   |

### getInputCallbackDelegate

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

```
public @NonNull InputCallbackDelegate getInputCallbackDelegate()
```

Returns the `https://developer.android.com/reference/androidx/car/app/model/InputCallbackDelegate` for input callbacks.

| See also |
|---|---|
| `https://developer.android.com/reference/androidx/car/app/model/signin/InputSignInMethod.Builder#Builder(androidx.car.app.model.InputCallback)` |   |

### getInputType

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/car-app#1.0.0)

```
public int getInputType()
```

Returns the input type, one of `https://developer.android.com/reference/androidx/car/app/model/signin/InputSignInMethod#INPUT_TYPE_DEFAULT()` or `https://developer.android.com/reference/androidx/car/app/model/signin/InputSignInMethod#INPUT_TYPE_PASSWORD()`

### getKeyboardType

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/car-app#1.0.0)

```
public int getKeyboardType()
```

Returns the type of keyboard to be displayed when this input gets focused.

| See also |
|---|---|
| `https://developer.android.com/reference/androidx/car/app/model/signin/InputSignInMethod.Builder#setKeyboardType(int)` |   |

### hashCode

```
public int hashCode()
```

### isShowKeyboardByDefault

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/car-app#1.0.0)

```
public boolean isShowKeyboardByDefault()
```

Returns whether to show the keyboard by default or not.

| See also |
|---|---|
| `https://developer.android.com/reference/androidx/car/app/model/signin/InputSignInMethod.Builder#setShowKeyboardByDefault(boolean)` |   |

### toString

```
public @NonNull String toString()
```