Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to launch voice input on the softkeyboard programatically?

The idea is to take a user voice input on the press of a button and pass it to the search inside the app. Because of device limitations we are using the SearchViewCompat instead of the useful SearchView. I have been able to grab the voice output using this link, but there is not a simple way to pass the text to the search bar this way.
The search view itself shows as a view (so no setText()), but if I can just say "use mic key on keyboard" or something as soon as the searchbar comes up, I think it might work. Any help would be greatly appreciated.
Thanks, SGB.

like image 929
Silas Greenback Avatar asked Jan 29 '26 02:01

Silas Greenback


1 Answers

No, it's not possible. At least, there is no simple way to launch voice input without using RecognitionListener or manually clicking the voice input button on soft keyboard.

As far as I know, this post explains how to integrate voice into an IME which actually uses this library: google-voice-typing-integration. It might inspire you a bit.

like image 184
Aaron He Avatar answered Jan 31 '26 14:01

Aaron He



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!