Biometric

Declaring dependencies

To add a dependency on Biometric, you must add the Google Maven repository to your project. Read Google's Maven repository for more information.

Add the dependencies for the artifacts you need in the build.gradle file for your app or module:

dependencies {
    def biometric_version = "1.0.0-beta02"

    implementation "androidx.biometric:biometric:$biometric_version"
  }

For more information about dependencies, see Add Build Dependencies.

Version 1.0.0-beta02

September 18, 2019

androidx.biometric:biometric:1.0.0-beta02 is released. Version 1.0.0-beta02 contains these commits.

Bug fixes

  • Fixed issues with device credential support in version 1.0.0-beta01
  • Removed Java 8 dependencies and switched to depending on Java 7 (b/140508526)
  • FingerprintHelperFragment now correctly throws ERROR_HW_NOT_PRESENT when no fingerprint hardware is detected (b/140427586)

Version 1.0.0-beta01

August 29, 2019

androidx.biometric:biometric:1.0.0-beta01 is released. Version 1.0.0-beta01 contains these commits.

New features

We’ve introduced a second constructor for BiometricPrompt that allows it to be hosted in a Fragment (as opposed to the existing constructor, which requires a FragmentActivity).

We’re also excited to bring the following functionality from Android 10 to the AndroidX Biometric library:

  1. BiometricManager#canAuthenticate
  2. BiometricPrompt.PromptInfo#setConfirmationRequired
  3. BiometricPrompt.PromptInfo#setDeviceCredentialAllowed

On Android 10, the library will invoke the corresponding methods from the platform API. On older API levels, the library will emulate the behavior.

API changes

  • Added fragment-specific constructor for biometric prompt (b/131980596)
  • See the “New features” section above.

Bug fixes

  • Add BiometricPrompt device credential support for L+
  • Fixed BiometricPrompt to use public error constants (b/137788194)
  • Fix NullPointerException in BiometricPrompt.onAttach() (b/136103103)
  • Changed behavior to not allow BiometricPrompt to be cancelled by a touch event outside the prompt (b/135684487)
  • Fixed onAuthenticationError crash when a null error value is returned in Kotlin (b/128350861)
  • FingerprintDialogFragment is now style-able (b/127878106)
  • FingerprintDialog is now scrollable (b/126367887)
  • Fixed bug where rotating the biometric dialog raises an IllegalStateException (b/124153656), (b/123811924)
  • Fixed inconsistent behavior on API Levels 23 to 27. (b/124066957)
  • Fixed issue where Fingerprint Login Dialog read incorrect text using Talkback. (b/123572331)

Version 1.0.0-alpha04

April 3, 2019

androidx.biometric:biometric:1.0.0-alpha04 is released. The commits included in this version can be found here.

Bug fixes

  • Fixed Biometric fragments don't clean up in all cases. (b/121117380)
  • Fixed BiometricPrompt only allows one instance of BiometricPrompt.AuthenticationCallback (b/123857949)
  • Fixed BiometricPrompt error behavior inconsistent between system and compat versions. (b/123572326)
  • Fixed callback onAuthenticationError() with @NotNull errString causes NullPointerException at runtime (b/123167217)
  • Fixed androidx.BiometricPrompt Cancel button Crashes (b/122054485)
  • Fixed androidx.biometric.PromptInfo title/description not changed on Android P (b/122856773)

Version 1.0.0-alpha03

December 17, 2018

Bug fixes

  • Fixed fragment-related issues
  • On devices O and older, lockout errors are returned immediately to be consistent with P and above