$ show firebase/FirebaseUI-Android
FirebaseUI-Android is an open-source library providing pre-built UI components for Firebase Authentication, Realtime Database, Cloud Firestore, and Cloud Storage. It is a multi-module Android library published on Maven Central. The primary module, `firebase-ui-auth`, has been rewritten in Jetpack Compose with Material 3, offering a high-level composable (`FirebaseAuthScreen`) and a Kotlin DSL for configuration. It supports 12+ identity providers (Google, Facebook, Email, Phone, Apple, etc.), multi-factor authentication (SMS/TOTP), credential linking, anonymous upgrade, and email link sign-in. The `firebase-ui-database` and `firebase-ui-firestore` modules provide RecyclerView adapters with paging support (AndroidX Paging 3) for displaying Firebase data. The `firebase-ui-storage` module integrates with Glide for loading images from Firebase Storage. A demo app and end-to-end tests against the Firebase Auth Emulator are included. Architecturally, the library is split into separate Gradle modules: `auth`, `database`, `firestore`, `storage`, `common`, and `lint`. The auth module uses Kotlin coroutines, StateFlow, and a sealed class state machine (`AuthState`) to manage authentication flows. The database/firestore modules are older Java-based implementations using lifecycle-aware adapters and observable arrays. The library maintains a version catalog (libs.versions.toml) with modern dependencies (Kotlin 2.4.10, AGP 9.3.0, Compose BOM 2026.06.01). Key entry points include `FirebaseAuthScreen` (Compose), `FirebaseAuthUI` (singleton for sign-out/delete/auth state), `AuthFlowController` (Activity-based alternative), `FirebaseRecyclerAdapter`/`FirestoreRecyclerAdapter`, and `FirebaseImageLoader` (Glide integration). The primary data flows involve Firebase SDKs for authentication, database listeners, and image loading. The library is designed to be embedded in host Android apps, handling complex auth flows with minimal developer effort. The codebase demonstrates strong craftsmanship in the auth moduleβs state machine and Compose UI, but shows signs of technical drift due to mixed UI generations (legacy XML layouts alongside new Compose), some deprecated API usage (e.g., `fetchSignInMethodsForEmail`, `startActivityForResult`), and incomplete localizations. The database/firestore modules are mature but use older patterns. Overall, the library is well-structured and actively maintained, with a beta version (10.0.0-beta04) indicating ongoing development.
The LLM identified 3 files worth highlighting for reuse:
A self-contained email validator using Android's Patterns.EMAIL_ADDRESS combined with additional length and character checks. It is a pure validation function that can be extracted and reused in any Android project requiring email validation, with no internal dependencies beyond the standard library.
A comprehensive, hardcoded list of all countries with ISO codes, dial codes, and flag emojis. This data is used for phone number country selection. While the data itself is static, the pattern of providing a complete, structured country dataset with flag emoji generation is self-contained and reusable in any Android app needing phone number input.
A generic caching snapshot parser that extends an observable array pattern. It uses an LRU cache to store parsed snapshots, invalidates on change events, and provides a clean abstraction for converting Firebase database snapshots to model objects. The pattern is isolated and can be reused in any project needing to parse and cache snapshot data from a real-time source.