Stypox / dicio-android

Dicio assistant app for Android
GNU General Public License v3.0
790 stars 72 forks source link

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

Open sudomain opened 2 years ago

sudomain commented 2 years ago

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.

Stypox commented 1 year ago

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

Stypox commented 3 months ago

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

sudomain commented 3 months ago

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

Stypox commented 3 months ago

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.