Stay organized with collections
Save and categorize content based on your preferences.
Strings
open class Strings
Provides localized strings for an application that uses BiometricPrompt
to authenticate the user.
Summary
Public methods
open fun getButtonLabel(): CharSequence?
Provides a localized string that can be used as the label for a button that invokes BiometricPrompt
.
When possible, this method should use the given authenticator requirements to more precisely specify the authentication type that will be used. For example, if Class 3 biometric authentication is requested on a device with a Class 3 fingerprint sensor and a Class 2 face sensor, the returned string should indicate that fingerprint authentication will be used.
This method should also try to specify which authentication method(s) will be used in practice when multiple authenticators meet the given requirements. For example, if biometric authentication is requested on a device with both face and fingerprint sensors but the user has selected face as their preferred method, the returned string should indicate that face authentication will be used.
This method may return null
if none of the requested authenticator types are available, but this should not be relied upon for checking the status of authenticators. Instead, use canAuthenticate(int)
.
Requires android.Manifest.permission#USE_BIOMETRIC
getPromptMessage
open fun getPromptMessage(): CharSequence?
Provides a localized string that can be shown while the user is authenticating with BiometricPrompt
.
When possible, this method should use the given authenticator requirements to more precisely specify the authentication type that will be used. For example, if Class 3 biometric authentication is requested on a device with a Class 3 fingerprint sensor and a Class 2 face sensor, the returned string should indicate that fingerprint authentication will be used.
This method should also try to specify which authentication method(s) will be used in practice when multiple authenticators meet the given requirements. For example, if biometric authentication is requested on a device with both face and fingerprint sensors but the user has selected face as their preferred method, the returned string should indicate that face authentication will be used.
This method may return null
if none of the requested authenticator types are available, but this should not be relied upon for checking the status of authenticators. Instead, use canAuthenticate(int)
.
Requires android.Manifest.permission#USE_BIOMETRIC
getSettingName
open fun getSettingName(): CharSequence?
Provides a localized string that can be shown as the title for an app setting that enables authentication with BiometricPrompt
.
When possible, this method should use the given authenticator requirements to more precisely specify the authentication type that will be used. For example, if Class 3 biometric authentication is requested on a device with a Class 3 fingerprint sensor and a Class 2 face sensor, the returned string should indicate that fingerprint authentication will be used.
This method should not try to specify which authentication method(s) will be used in practice when multiple authenticators meet the given requirements. For example, if biometric authentication is requested on a device with both face and fingerprint sensors, the returned string should indicate that either face or fingerprint authentication may be used, regardless of whether the user has enrolled or selected either as their preferred method.
This method may return null
if none of the requested authenticator types are supported by the system, but this should not be relied upon for checking the status of authenticators. Instead, use canAuthenticate(int)
or android.content.pm.PackageManager#hasSystemFeature(String)
.
Requires android.Manifest.permission#USE_BIOMETRIC
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-02-10 UTC."],[],[],null,["# BiometricManager.Strings\n\nAdded in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nStrings\n=======\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/android/hardware/biometrics/BiometricManager.Strings \"View this page in Java\") \n\n```\nopen class Strings\n```\n\n|---|-----------------------------------------------------------|\n| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) ||\n| ↳ | [android.hardware.biometrics.BiometricManager.Strings](#) |\n\nProvides localized strings for an application that uses [BiometricPrompt](/reference/kotlin/android/hardware/biometrics/BiometricPrompt) to authenticate the user.\n\nSummary\n-------\n\n| Public methods ||\n|-----------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| open [CharSequence](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-char-sequence/index.html)? | [getButtonLabel](#getButtonLabel())`()` Provides a localized string that can be used as the label for a button that invokes [BiometricPrompt](/reference/kotlin/android/hardware/biometrics/BiometricPrompt). |\n| open [CharSequence](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-char-sequence/index.html)? | [getPromptMessage](#getPromptMessage())`()` Provides a localized string that can be shown while the user is authenticating with [BiometricPrompt](/reference/kotlin/android/hardware/biometrics/BiometricPrompt). |\n| open [CharSequence](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-char-sequence/index.html)? | [getSettingName](#getSettingName())`()` Provides a localized string that can be shown as the title for an app setting that enables authentication with [BiometricPrompt](/reference/kotlin/android/hardware/biometrics/BiometricPrompt). |\n\nPublic methods\n--------------\n\n### getButtonLabel\n\nAdded in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nopen fun getButtonLabel(): CharSequence?\n```\n\nProvides a localized string that can be used as the label for a button that invokes [BiometricPrompt](/reference/kotlin/android/hardware/biometrics/BiometricPrompt).\n\nWhen possible, this method should use the given authenticator requirements to more precisely specify the authentication type that will be used. For example, if **Class 3** biometric authentication is requested on a device with a **Class 3** fingerprint sensor and a **Class 2** face sensor, the returned string should indicate that fingerprint authentication will be used.\n\nThis method should also try to specify which authentication method(s) will be used in practice when multiple authenticators meet the given requirements. For example, if biometric authentication is requested on a device with both face and fingerprint sensors but the user has selected face as their preferred method, the returned string should indicate that face authentication will be used.\n\nThis method may return `null` if none of the requested authenticator types are available, but this should *not* be relied upon for checking the status of authenticators. Instead, use [canAuthenticate(int)](/reference/kotlin/android/hardware/biometrics/BiometricManager#canAuthenticate(kotlin.Int)). \nRequires [android.Manifest.permission#USE_BIOMETRIC](../../Manifest.permission.html#USE_BIOMETRIC:kotlin.String)\n\n| Return ||\n|------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------|\n| [CharSequence](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-char-sequence/index.html)? | The label for a button that invokes [BiometricPrompt](/reference/kotlin/android/hardware/biometrics/BiometricPrompt) for authentication. |\n\n### getPromptMessage\n\nAdded in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nopen fun getPromptMessage(): CharSequence?\n```\n\nProvides a localized string that can be shown while the user is authenticating with [BiometricPrompt](/reference/kotlin/android/hardware/biometrics/BiometricPrompt).\n\nWhen possible, this method should use the given authenticator requirements to more precisely specify the authentication type that will be used. For example, if **Class 3** biometric authentication is requested on a device with a **Class 3** fingerprint sensor and a **Class 2** face sensor, the returned string should indicate that fingerprint authentication will be used.\n\nThis method should also try to specify which authentication method(s) will be used in practice when multiple authenticators meet the given requirements. For example, if biometric authentication is requested on a device with both face and fingerprint sensors but the user has selected face as their preferred method, the returned string should indicate that face authentication will be used.\n\nThis method may return `null` if none of the requested authenticator types are available, but this should *not* be relied upon for checking the status of authenticators. Instead, use [canAuthenticate(int)](/reference/kotlin/android/hardware/biometrics/BiometricManager#canAuthenticate(kotlin.Int)). \nRequires [android.Manifest.permission#USE_BIOMETRIC](../../Manifest.permission.html#USE_BIOMETRIC:kotlin.String)\n\n| Return ||\n|------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------|\n| [CharSequence](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-char-sequence/index.html)? | The label for a button that invokes [BiometricPrompt](/reference/kotlin/android/hardware/biometrics/BiometricPrompt) for authentication. |\n\n### getSettingName\n\nAdded in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nopen fun getSettingName(): CharSequence?\n```\n\nProvides a localized string that can be shown as the title for an app setting that enables authentication with [BiometricPrompt](/reference/kotlin/android/hardware/biometrics/BiometricPrompt).\n\nWhen possible, this method should use the given authenticator requirements to more precisely specify the authentication type that will be used. For example, if **Class 3** biometric authentication is requested on a device with a **Class 3** fingerprint sensor and a **Class 2** face sensor, the returned string should indicate that fingerprint authentication will be used.\n\nThis method should *not* try to specify which authentication method(s) will be used in practice when multiple authenticators meet the given requirements. For example, if biometric authentication is requested on a device with both face and fingerprint sensors, the returned string should indicate that either face or fingerprint authentication may be used, regardless of whether the user has enrolled or selected either as their preferred method.\n\nThis method may return `null` if none of the requested authenticator types are supported by the system, but this should *not* be relied upon for checking the status of authenticators. Instead, use [canAuthenticate(int)](/reference/kotlin/android/hardware/biometrics/BiometricManager#canAuthenticate(kotlin.Int)) or [android.content.pm.PackageManager#hasSystemFeature(String)](../../content/pm/PackageManager.html#hasSystemFeature(kotlin.String)). \nRequires [android.Manifest.permission#USE_BIOMETRIC](../../Manifest.permission.html#USE_BIOMETRIC:kotlin.String)\n\n| Return ||\n|------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------|\n| [CharSequence](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-char-sequence/index.html)? | The label for a button that invokes [BiometricPrompt](/reference/kotlin/android/hardware/biometrics/BiometricPrompt) for authentication. |"]]