Face recognition authentication in Android: biometric implementation

Face recognition authentication in Android: implementing biometric login "I want face login like on iPhone, but on Android." Sound familiar? The challenge is that the Android ecosystem is fragmented: from flagship devices with infrared sensors to budget models with a regular front camera, where f

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 1All 1734 services
Face recognition authentication in Android: biometric implementation
Medium
~1 day

Our competencies:

Frequently Asked Questions

Latest works

  • image_mobile-applications_feedme_467_0.webp
    Development of a mobile application for FEEDME
    895
  • image_mobile-applications_xoomer_471_0.webp
    Development of a mobile application for XOOMER
    782
  • image_mobile-applications_rhl_428_0.webp
    Development of a mobile application for RHL
    1216
  • image_mobile-applications_zippy_411_0.webp
    Development of a mobile application for ZIPPY
    1079
  • image_mobile-applications_affhome_429_0.webp
    Development of a mobile application for Affhome
    1002
  • image_mobile-applications_flavors_409_0.webp
    Development of a mobile application for the FLAVORS company
    597

Face recognition authentication in Android: implementing biometric login

"I want face login like on iPhone, but on Android." Sound familiar? The challenge is that the Android ecosystem is fragmented: from flagship devices with infrared sensors to budget models with a regular front camera, where face recognition is just a convenient replacement for a swipe gesture. Instead of a single standard, there's a zoo of implementations: BiometricPrompt, Huawei's own biometrics (HMS), and sometimes no hardware support at all.

Our experience: over 7 years we have implemented face biometric authentication in 20+ projects, including banking apps and fintech services. According to the BiometricPrompt API, using Class 3 is recommended for financial transactions. Implementing biometric authentication on Android with face recognition requires accounting for fragmentation.

Android biometrics are divided into three security classes. For financial operations, only Class 3 fits — hardware guarantee with verification in TEE. Using Class 1 or 2 makes spoofing attacks with a photo inevitable.

What biometric classes exist and why does it matter?

Android splits biometrics into three classes. Here's a comparison:

Class Sensor Type Security Level Allowed Scenarios
Class 1 (Convenience) Front camera without IR Low — photo spoofing possible Screen unlock only
Class 2 (Weak) Camera with improved algorithm Medium — partial protection Non-financial app authentication
Class 3 (Strong) IR sensor + TEE High — hardware guarantee Payments, banking, sensitive data

BiometricPrompt, when used properly, is 3 times more secure than custom solutions because it relies on TEE. Calling BiometricManager.canAuthenticate(BIOMETRIC_STRONG) returns the correct class only if a hardware sensor is present. For financial apps, we accept only Class 3.

How to implement BiometricPrompt for face recognition?

The code is identical to fingerprint authentication — the same BiometricPrompt, the same CryptoObject. The difference is that the system selects the prompt based on available biometrics. However, on some firmwares (Honor, MIUI), the prompt may show both face and fingerprint simultaneously — this is normal behavior.

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() opens system settings via Intent(Settings.ACTION_BIOMETRIC_ENROLL) with extras. Important: when the screen rotates or Activity is recreated, an open prompt disappears without a callback. Solution — track isAuthenticating flag in ViewModel and restart the prompt in onResume. Alternatively, use rememberLauncherForActivityResult in Jetpack Compose.

Why doesn't BiometricPrompt work on Huawei without GMS?

Huawei with HMS is a separate headache. Standard BiometricPrompt is absent. The solution: add com.huawei.hms:base and use HuaweiBiometricManager via reflection or conditional compilation under the HMS flavor. This adds 2–3 days to development time.

More about Huawei HMS On Huawei devices without GMS, connect `com.huawei.hms:base` and use `HuaweiBiometricManager` via reflection or conditional compilation. This adds 2–3 days to the schedule.

Device fragmentation: what we check manually

Manufacturer Peculiarity
Samsung (One UI 5+) Face ID Strong on flagships, Weak on budget
Xiaomi / MIUI 14 canAuthenticate may return an incorrect class — need additional check
Pixel 6+ Full Strong via under-display sensor or front IR
Huawei (HMS) Own FaceManager API when GMS is absent

Security: how to protect against spoofing?

2D photo-based recognition is vulnerable to photo spoofing attacks. We never use Class 1 for money-related operations. If the client insists on supporting older budget devices — we propose a two-factor scheme: face (Class 1) + PIN. This formally satisfies 2FA requirements without compromising security.

What's included in the work

  • Audit of the target device fleet and determination of the minimum biometric class
  • Implementation of KeyStore + CryptoObject flow with key storage in TEE
  • Handling of Huawei HMS scenario (if needed)
  • Testing on physical devices — no less than 10 models from different vendors
  • Documentation listing limitations by manufacturer
  • Post-release support for 14 days

Process and timelines

  1. Analytics — define target devices and biometric class (1–2 days)
  2. Design — authentication scheme with fallback methods (1 day)
  3. Implementation — integrate BiometricPrompt, error handling, key management (3–5 days)
  4. Testing — on real devices from different vendors (2–3 days) — saves up to 30% through automation
  5. Documentation — model limitations and recommendations (1 day)

Timelines: from 5 to 10 business days depending on the need for HMS support and the amount of testing. Budget is calculated individually.

Order turnkey development: we guarantee correct operation on 95% of popular devices and full compliance with BiometricPrompt API security recommendations. Get a free consultation for your project — contact us.