Android Face Recognition Biometric Authentication

NOVASOLUTIONS.TECHNOLOGY is engaged in the development, support and maintenance of iOS, Android, PWA mobile applications. We have extensive experience and expertise in publishing mobile applications in popular markets like Google Play, App Store, Amazon, AppGallery and others.
Development and support of all types of mobile applications:
Information and entertainment mobile applications
News apps, games, reference guides, online catalogs, weather apps, fitness and health apps, travel apps, educational apps, social networks and messengers, quizzes, blogs and podcasts, forums, aggregators
E-commerce mobile applications
Online stores, B2B apps, marketplaces, online exchanges, cashback services, exchanges, dropshipping platforms, loyalty programs, food and goods delivery, payment systems.
Business process management mobile applications
CRM systems, ERP systems, project management, sales team tools, financial management, production management, logistics and delivery management, HR management, data monitoring systems
Electronic services mobile applications
Classified ads platforms, online schools, online cinemas, electronic service platforms, cashback platforms, video hosting, thematic portals, online booking and scheduling platforms, online trading platforms

These are just some of the types of mobile applications we work with, and each of them may have its own specific features and functionality, tailored to the specific needs and goals of the client.

Showing 1 of 1 servicesAll 1735 services
Android Face Recognition Biometric Authentication
Medium
~1 business day
FAQ
Our competencies:
Development stages
Latest works
  • image_mobile-applications_feedme_467_0.webp
    Development of a mobile application for FEEDME
    756
  • image_mobile-applications_xoomer_471_0.webp
    Development of a mobile application for XOOMER
    624
  • image_mobile-applications_rhl_428_0.webp
    Development of a mobile application for RHL
    1052
  • image_mobile-applications_zippy_411_0.webp
    Development of a mobile application for ZIPPY
    947
  • image_mobile-applications_affhome_429_0.webp
    Development of a mobile application for Affhome
    862
  • image_mobile-applications_flavors_409_0.webp
    Development of a mobile application for the FLAVORS company
    445

Developing Face Recognition Biometric Authorization in Android App

Biometric face recognition on Android — not Face ID. Apple — infrared projection of 30,000 points, hardware Secure Enclave, guaranteed protection class. Android — range from infrared sensor on Pixel 8 to simple front camera on budget devices. And this very range creates most problems during development.

Biometric classes and why it matters

Android divides biometrics into three security classes:

  • Class 1 (Convenience) — weak: front camera without infrared sensor, typically 2D photo recognition. Not suitable for financial operations.
  • Class 2 (Weak) — medium: somewhat better, but still no Secure Enclave guarantee.
  • Class 3 (Strong) — hardware guarantee, result verified by TEE (Trusted Execution Environment) or Secure Element.

Call BiometricManager.canAuthenticate(BIOMETRIC_STRONG) returns BIOMETRIC_ERROR_NONE_ENROLLED or BIOMETRIC_ERROR_NO_HARDWARE on devices where face registered as Class 1. This means: cannot just ask for "face biometrics" — must explicitly check class and decide.

For banking and fintech apps accept only BIOMETRIC_STRONG. For others — can accept BIOMETRIC_WEAK with user warning.

Implementation via BiometricPrompt

API identical to fingerprint authentication — same BiometricPrompt, same CryptoObject. Difference that BiometricManager.canAuthenticate() returns correct class for face, and system itself chooses what to show user — fingerprint prompt or face prompt.

Important nuance: on some devices (Honor, some MIUI versions) system shows face and fingerprint prompt simultaneously. This is standard behavior — system offers first available method.

val biometricManager = BiometricManager.from(context)
val canAuthenticate = biometricManager.canAuthenticate(
    BiometricManager.Authenticators.BIOMETRIC_STRONG
)
when (canAuthenticate) {
    BiometricManager.BIOMETRIC_SUCCESS -> launchBiometricPrompt()
    BiometricManager.BIOMETRIC_ERROR_NO_HARDWARE -> showFallback()
    BiometricManager.BIOMETRIC_ERROR_HW_UNAVAILABLE -> showTemporaryError()
    BiometricManager.BIOMETRIC_ERROR_NONE_ENROLLED -> promptEnrollment()
}

promptEnrollment() — open system biometric settings via Intent(Settings.ACTION_BIOMETRIC_ENROLL) with extras EXTRA_BIOMETRIC_AUTHENTICATORS_ALLOWED = BIOMETRIC_STRONG.

Prompt lifecycle and Fragment back stack

BiometricPrompt tied to FragmentActivity. If user taps "back" while showing prompt — calls onAuthenticationError with code ERROR_USER_CANCELED. But if Activity recreated (screen rotation) while prompt open — prompt disappears without callback. Solution: track isAuthenticating flag in ViewModel and restart prompt at onResume if flag active.

Device fragmentation: what we check manually

Manufacturer Feature
Samsung (One UI 5+) Face ID Class Strong on flagships, Weak on budget
Xiaomi / MIUI 14 canAuthenticate may return wrong class — need extra check
Pixel 6+ Full-featured Strong via under-display sensor or front IR
Huawei (HMS) Own FaceManager API when no GMS

Huawei without GMS — separate story. There BiometricPrompt doesn't work. Connect com.huawei.hms:base and use HuaweiBiometricManager via reflection or conditional compilation under HMS flavor.

Security: spoofing attacks

Face recognition via 2D photo vulnerable to photo attack. Google Play Protect doesn't block apps with Class 1 biometrics, but financial regulators (PCI DSS, Central Bank requirements) explicitly forbid using it for payment authorization. Never use Class 1 for money operations or sensitive data.

If client insists on supporting old budget devices — offer two-factor scheme: face (Class 1) + PIN. This formally satisfies 2FA requirements without compromising security.

Work stages and timeframe

Audit target device pool → determine minimum biometric class → implement KeyStore + CryptoObject flow → handle HMS scenario (if needed) → test on physical devices of different manufacturers → document limitations per model.

Timeframe: 5–10 business days. Testing on real devices of different vendors takes significant time — emulator nearly useless here.