I am very new to Android development, and recently I've been working on a project for college using an Android phone that, in sum, is constantly listening for the user's voice until they say a specific word or phrase, and then it executes an action. It has to listen the user even when the phone is locked. As for now, battery consumption is not a concern.
My issue is I have no idea how to run this on background. I've read about Services
, WorkManager
and JobScheduler
, none of which seems to continuously run speech recognition while the phone is locked. I found similiar questions from several years ago but no definitive answer.
Is there any way to do this?
Similar questions:
Speech Recognition as a service.(Android)
Android Speech Recognition as a service on Android 4.1 & 4.2
Android Speech Recognition Continuous Service
Asked
Active
Viewed 349 times
0

Foster
- 1
-
With Android 9, apps cannot access the microphone in the background: https://developer.android.com/guide/topics/media/mediarecorder If you are wondering how certain devices have "wake words" that work through screen lock, that would be custom software by device manufacturer, or faking a lock screen and being always active, and/or running on older versions of Android. – Morrison Chang Sep 02 '20 at 21:37
-
Ah, that's unfortunate, but thanks for the answer. – Foster Sep 02 '20 at 22:42