Hey devs 👋
I’m Jigin, and I’ve been building Android apps for a while now — from traditional login flows to full-blown business management tools. Lately, I’ve been diving into biometric authentication, and I thought I’d share a quick guide, some tips, and a few hard-learned lessons that might help fellow devs out there.
Whether you’re looking to tighten security or give your users that sweet “just tap and go” experience, this one’s for you.
🔐 Why Biometric Authentication?
Security: Passwords can be forgotten. Biometrics are you.
Convenience: One tap > typing passwords.
Trust: Modern apps with native biometric support feel polished and reliable.
What I Used
Language: Kotlin
Tools: BiometricPrompt API
Min SDK: 23 (but actual support starts from Android 6.0+)
Basic Implementation Steps
val executor = ContextCompat.getMainExecutor(this)
val biometricPrompt = BiometricPrompt(this, executor,
object : BiometricPrompt.AuthenticationCallback() {
override fun onAuthenticationSucceeded(result: BiometricPrompt.AuthenticationResult) {
super.onAuthenticationSucceeded(result)
// Navigate or unlock secured features
}
override fun onAuthenticationFailed() {
super.onAuthenticationFailed()
// Handle failure
}
})
val promptInfo = BiometricPrompt.PromptInfo.Builder()
.setTitle("Biometric Login")
.setSubtitle("Log in using your fingerprint")
.setNegativeButtonText("Cancel")
.build()
biometricPrompt.authenticate(promptInfo)
⚠️ Gotchas I Faced
Emulator doesn’t help – Test on real devices!
Fallback login – Always have PIN/password fallback for devices without biometrics.
Handle all cases – Locked biometrics, no enrolled fingerprint, hardware not available, etc.
💡 Pro Tips
Use BiometricManager to check device capabilities before launching the prompt.
Use encrypted SharedPreferences if you’re storing auth flags.
Keep UX smooth — if biometric fails, don’t force the user through a maze.
Real-World Use Case
I recently integrated this in an internal business management app, where biometric unlock helped speed up logins for admins accessing sensitive financial data. It improved both user satisfaction and compliance.
🗣️ Final Thoughts
Biometric auth isn’t just “cool tech” anymore — it’s becoming a user expectation. With just a few lines of code and good fallback handling, you can add it to your Android app and instantly make it feel more modern and secure.
Let me know if you’d like a version of this for Kotlin Multiplatform or paired with a Spring Boot backend — that’s something I’ve been playing with too. 😄
Signing off,
Jigin – Trying to keep things secure and smooth, one tap at a time.