简体   繁体   中英

Is it possible for google assistant to press a button in a certain app on Android?

I'm new to Android programming. I just created a simple program with a couple of buttons. Each button does something unique. Pushing Button 1 prints out "First Button" and button 2 prints out "Second Button" in a new view.

I want to ask Google assistant to press button 1 in my app. I want my app to open (if it's not already open) and show the message "First Button". I want it to do the same with the button 2 basically showing "Second Button" when I ask it.

I'm using Java in Android Studio. I researched a few things to try and find an answer and came across "DialogFlow" and "Actions SDK". I also read about deep links but I'm not really seeing exactly what I'm looking for. They seem more for people that are trying to sell stuff on their website to get the user to the page they want. I got it to open up the app but how do I emulate a button press?

Thank you in advance!

Maybe you should look at these links - https://developers.google.com/assistant/app/ and https://developer.android.com/guide/slices . If you google assistant to trigger a button action or go to a particular screen. Deep-link or App link is a way to navigate to any part of the app based on the click event on the hyperlink. I had previous research on similar idea. Those links should give you an idea.

Try to look at this: Custom intents .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM