This is an educational example app showcasing best practices for implementing voice recognition in modern Android applications.
Overview
The Voice to Text app is a clean, minimalist Android application that demonstrates how to implement speech-to-text functionality using Android’s built-inRecognizerIntent API. Built entirely with Jetpack Compose and Material3 design, it provides a modern UI that allows users to convert their spoken words into text instantly.
Quickstart
Get the app running on your device in minutes
Speech Recognition
Learn how speech-to-text conversion works
API Reference
Detailed documentation of key functions and classes
Permissions
Handle audio recording permissions properly
Key features
Speech-to-text conversion
The app uses Android’sRecognizerIntent.ACTION_RECOGNIZE_SPEECH to convert spoken words into text. The recognition is powered by Google’s speech recognition service, providing accurate results in real-time.
Runtime permission handling
The app properly requests and handles theRECORD_AUDIO permission at runtime, following Android’s best practices for permission management. Users are prompted only when they attempt to use the voice recognition feature.
Modern Jetpack Compose UI
Built entirely with Jetpack Compose, the app features:- Material3 design components
- Edge-to-edge layout support
- Composable functions for reusable UI elements
- State management using
rememberandmutableStateOf
Activity result API
The app demonstrates the modernActivityResultContracts API instead of the deprecated onActivityResult() method, showing how to handle speech recognition results in a type-safe manner.
Technical specifications
What you’ll learn
By exploring this app, you’ll gain hands-on experience with:- Implementing speech recognition using
RecognizerIntent - Building UIs with Jetpack Compose and Material3
- Handling runtime permissions properly
- Using the Activity Result API for launching intents
- Managing UI state with Compose’s state management
- Creating custom text fields with decoration boxes