Search code examples
androidvoicegoogle-assistant-sdk

Add a command in google assistant to trigger a function in your android app


I can use the google assistant to open an application, but can I also add a phrase to the google assistant which triggers a particular function in my application?

Eg.

saying "Ok google. resume stopwatch in blahblahApp" 

should trigger a function (say ResumeStopwatch()) in my app blahblahApp.

A way to either customize my device for this capability or integrating some package in my app to accomplish this.


Solution

  • You should look at App Actions which gives a way for a user to give commands which can trigger some execution in your app.