Stypox/dicio-android

feature request: start the Dicio listening service in background via intent

Opened this issue · 4 comments

From a comment in #64 , I'd like to be able start the listening service in the background via an intent. Personally I'd send it via Termux's implementation of am and/or a KeyMapper action.

Unrelated note: #109 adds support for recognizing speech via intent

Would #227 suit you? It implements a RecognitionService, though I doubt it can be used directly from a single intent.

Possibly, but I changed strategy and I've been using a different app (Sayboard) which implements an IME to get user input. It isn't pretty, but it works 😁.

With Dicio, the closest I've been able to get is with this command:
am start -a android.speech.action.RECOGNIZE_SPEECH -e android.speech.extra.PROMPT "My custom prompt", however the text does not get sent to Termux (running in the foreground) when the checkmark button is pressed (this is probably a limitation of am). When I was testing it, as a workaround, I was able to copy to the clipboard and then get the result with termux-clipboard-get, but Dicio doesn't have a way to programmatically copy to the clipboard.

EDIT: I tried the same things with the test apk in that PR, but ran into the same problems

Yeah nothing has changed with respect to RECOGNIZE_SPEECH, however you may try the RecognitionService. Though I have no idea if that can be used with intents, or if an app needs to implement a service receiver in-code.