6

In the past you could use Google Now to send SMSes, Hangouts and emails. However, a recent update will allow you to use the service to send messages through WhatsApp, Viber, WeChat, Telegram and NextPlus. The process looks like this:

  • Say "Ok, Google," then wait for the app to start listening.
  • Follow up with "Send a whatsapp message to [contact name] saying [your message]" Ex: "Send a whatsapp message to Jeff saying How are you?" You will see the app icon appear on the information card with your message, and then you can confirm sending by saying yes or tapping the arrow button.

Well, so there is an option to send a message from Google Now to Whatsapp, without clicking on the send button inside Whatsapp, thats mean there is an intent that doing that, right?

So, my question is, what is that intent? And can I use it in my own app?

Nirel
  • 1,855
  • 1
  • 15
  • 26

2 Answers2

-1

To initiate a Google Now Voice search, use this:

Intent voiceIntent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);
startActivityForResult(voiceIntent, 1234);
frgnvola
  • 518
  • 3
  • 16
  • Using this intent would prompt the use of Google Now in your app... I thought this was what you were asking for, was I mistaken? – frgnvola Aug 03 '15 at 23:10
  • Yes, i dont want to use Google Now in my app, i want to use same Intent that Google Now using – Nirel Aug 03 '15 at 23:16
  • My bad; looking into the source code for Google Now should provide you with that – frgnvola Aug 03 '15 at 23:23
-1

Use the official API

I would do it through a URL procedure. you can learn from it in a more complete answer over here (we shouldn't duplicate the answers):

https://stackoverflow.com/a/52030187/1920145

DavidTaubmann
  • 3,223
  • 2
  • 34
  • 43
  • You can't just send a message via this api – Nirel Aug 27 '18 at 18:46
  • I believe what you're looking for would require special permissions for your app to access specifically another app: WhatsApp... I believe there's no approach for an app asking permissions for another specific app. Maybe you should check first what are the permissions Google Assistant requires. – DavidTaubmann Aug 28 '18 at 16:49