且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

带有SpeechRecognizer的Android自定义键盘

更新时间:2022-11-20 12:32:19

您的屏幕截图显示"Google语音输入",这是一个独立的IME,由Google键盘在按下其麦克风按钮时调用.因此,您的IME应该做同样的事情:用提供语音键入功能的IME代替自己,并希望在完成语音键入操作后有指向您IME的反向链接.

Your screenshot shows "Google voice typing", which is an independent IME that is called by the Google Keyboard when its microphone button is pressed. So, your IME should do the same: replace itself with an IME that provides voice typing, and hope that there is a backlink to your IME once the voice typing is done.

最简单的实现是在IME子类型之间进行切换,但您可能希望拥有更多控制权,例如使用特定的输入参数等启动特定的IME.我不确定实现此额外控制的***/标准方法是什么.

The simplest implementation would be Switching among IME Subtypes, but you might want to have more control, e.g. start a specific IME with specific input parameters, etc. I'm not sure what is the best/standard way to achieve this extra control.

以语音输入IME为例,您可以查看(我的应用程序)Kõnele.

For an example of a voice typing IME you could look into (my app) Kõnele.