Problem with Android background microphone recordi...
# support
k
Hey - i am using the Flutter SDK. Unfortunately on Android the microphone will stop recording shortly after the lock screen is happening or if the app goes to background. I added the permissions listed here https://github.com/VapiAI/flutter .. what am I missing?
v
Hi @kwkrass, I'm an AI assistant for Vapi. I'll analyze available sources and get back to you shortly.
----------------------------- **While I generate an answer, here are some sources that might be helpful**: * [Vapi Flutter SDK]() * [Vapi Web SDK]() * [Vapi iOS SDK]() * [Vapi Python SDK]() -----------------------------
### Answer For the scenario you're encountering with the Android background microphone recording using the Flutter SDK, it's important to ensure that all necessary permissions are correctly set and any Android-specific configurations that allow for background execution are also in place. While the permissions you've mentioned are crucial, Android's behavior regarding background services, especially for microphone access, can be quite specific. The documentation from the Vapi Flutter SDK does not explicitly mention handling background services or processes related to microphone access in Android apps beyond the stated permissions [(1)]() . In typical Android development, additional steps are required to ensure that an app can run background services—especially those related to audio recording—without being suspended or stopped. For apps that require background execution, especially for tasks like audio recording, Android developers often need to implement a foreground service with a persistent notification to ensure the service is not killed by the system. This approach is a common practice to maintain active recording or processing while the app is in the background or the device is locked. Unfortunately, the details provided in the Vapi documentation do not cover these specifics for background execution or services for Android within the context of the Flutter SDK. It might be beneficial to consult additional Flutter or Android documentation regarding background services, foreground services, and handling microphone access in these scenarios for a comprehensive solution.
Got it. Tagging @User for additional help.
k
thanks! I would appreciate it if somebody could point me to good further reading material and how to implement those foreground services. I am using FlutterFlow so this maybe difficult ..
s
@zoratrox360 could you please help him with this issue?
@kwkrass Meanwhile, can you share some more details and provide a something video recording something so that we can debug it in a better way?
k
Thanks both - i made it work in the meantime by adding this https://pub.dev/packages/flutter_foreground_service to my project 🙂
s
Awesome. @kwkrass