This project demonstrates the implementation of native modules in React Native, specifically focusing on audio recording functionality with background support on Android.
This React Native application showcases the integration of native Android modules to enable audio recording capabilities. Key features include:
- Custom native module for audio recording
- Background audio recording using Android's foreground services
- Support for Android API level 34 and above
The project includes the following key components:
AudioRecorderModule: A React Native bridge module that exposes audio recording functions to JavaScript.AudioRecorderService: A Kotlin service that handles the actual audio recording functionality.AudioRecorderForegroundService: An Android foreground service that allows audio recording to continue in the background.
Ensure you have completed the React Native - Environment Setup before proceeding.
- Clone the repository
- Install dependencies:
npm install # or yarn install
-
Start the Metro server:
npm start # or yarn start -
Run the app on Android:
npm run android # or yarn android
The app provides a simple interface to start and stop audio recording. The recording will continue even when the app is in the background, thanks to the implemented foreground service.
No code has been added to handle permissions on this test app. Make sure to manually grant the necessary permissions for audio recording and background services.