Search code examples
androidandroid-widgetvoice-recognitiongoogle-speech-api

Is there any way to use google speech API (default free version) from android widget?


I'm trying to enable google speech API from the android widget. My idea is like if some click on a button from widget it will the API will start listening.


Solution

  • AppWidgetProvider is just a BroadcastReceiver. Seems like google speech api need to bind to his service. But you can't bind to service from broadcast receiver. So the way is to use another service and bindService will work.

    So just start your service (on button click from remoteViews) and make all your stuff with speech api here.