There is an idea to make an application which by default would show the clock, but in the background it waited for commands like "ok google" and performed programmed actions, and if there were no commands, it would send this request to google now which in turn performed a google search and said and prompted. Recognition of ready-made requests is more or less clear, but how to send a request to google now, I didn’t find such information in place, so that when you start google now, you can send a request to it right away.
1 answer
Officially, there is no API in google now that would allow you to send a request to it. But unofficially - there is:
final Intent intent = new Intent(Intent.ACTION_WEB_SEARCH); intent.setPackage("com.google.android.googlequicksearchbox"); intent.putExtra(SearchManager.QUERY, "Ваш запрос"); startActivity(intent); P. S. Found in Google for a minute and a half
P. P. C The Google application must be installed on your phone for it to work. Otherwise, Exception will Exception
|