Merge "Docs: Renamed Google Now to Google Voice Actions" into nyc-docs
This commit is contained in:
@@ -99,7 +99,6 @@ page.tags="IntentFilter"
|
|||||||
</ol>
|
</ol>
|
||||||
</li>
|
</li>
|
||||||
<li><a href="#AdbIntents">Verify Intents with the Android Debug Bridge</a></li>
|
<li><a href="#AdbIntents">Verify Intents with the Android Debug Bridge</a></li>
|
||||||
<li><a href="#Now">Intents Fired by Google Now</a></li>
|
|
||||||
</ol>
|
</ol>
|
||||||
|
|
||||||
<h2>See also</h2>
|
<h2>See also</h2>
|
||||||
@@ -110,9 +109,9 @@ Filters</a></li>
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Google Now box styles -->
|
<!-- Google Voice Actions box styles -->
|
||||||
<style type="text/css">
|
<style type="text/css">
|
||||||
.now-box {
|
.voice-box {
|
||||||
border-color: rgb(204,204,204);
|
border-color: rgb(204,204,204);
|
||||||
border-style: solid;
|
border-style: solid;
|
||||||
border-width: 1px;
|
border-width: 1px;
|
||||||
@@ -121,99 +120,120 @@ Filters</a></li>
|
|||||||
padding: 17px;
|
padding: 17px;
|
||||||
width: 200px;
|
width: 200px;
|
||||||
}
|
}
|
||||||
.now-box li {
|
.voice-box li {
|
||||||
font-size: 13px;
|
font-size: 13px;
|
||||||
font-style: italic;
|
font-style: italic;
|
||||||
margin-top: 0px;
|
margin-top: 0px;
|
||||||
}
|
}
|
||||||
.now-box ul {
|
.voice-box ul {
|
||||||
margin-bottom: 0px;
|
margin-bottom: 0px;
|
||||||
}
|
}
|
||||||
.now-img {
|
.voice-img {
|
||||||
width: 30px;
|
width: 30px;
|
||||||
margin-bottom: 0px !important;
|
margin-bottom: 0px !important;
|
||||||
}
|
}
|
||||||
.now-img-cont {
|
.voice-img-cont {
|
||||||
float: left;
|
float: left;
|
||||||
margin-right: 10px;
|
margin-right: 10px;
|
||||||
}
|
}
|
||||||
.now-title {
|
.voice-title {
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
margin-top: 7px;
|
margin-top: 7px;
|
||||||
}
|
}
|
||||||
.now-list {
|
.voice-list {
|
||||||
font-size: 13px;
|
font-size: 13px;
|
||||||
margin-bottom: 10px !important;
|
margin-bottom: 10px !important;
|
||||||
list-style-type: none;
|
list-style-type: none;
|
||||||
}
|
}
|
||||||
.now-list li {
|
.voice-list li {
|
||||||
font-style: italic;
|
font-style: italic;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<p>An intent allows you to start an activity in another app by describing a simple
|
<p>
|
||||||
action you'd like to perform (such as "view a map" or "take a picture")
|
An intent allows you to start an activity in another app by describing a
|
||||||
in an {@link android.content.Intent} object. This type of intent is
|
simple action you'd like to perform (such as "view a map" or "take a
|
||||||
called an <em>implicit</em> intent because it does not specify the app component
|
picture") in an {@link android.content.Intent} object. This type of intent
|
||||||
to start, but instead specifies an <em>action</em> and provides some
|
is called an <em>implicit</em> intent because it does not specify the app
|
||||||
<em>data</em> with which to perform the action.</p>
|
component to start, but instead specifies an <em>action</em> and provides
|
||||||
|
some <em>data</em> with which to perform the action.
|
||||||
|
</p>
|
||||||
|
|
||||||
<p>When you call
|
<p>
|
||||||
{@link android.content.Context#startActivity startActivity()} or
|
When you call {@link android.content.Context#startActivity startActivity()}
|
||||||
{@link android.app.Activity#startActivityForResult startActivityForResult()} and pass it an
|
or {@link android.app.Activity#startActivityForResult
|
||||||
implicit intent, the system <a href="{@docRoot}guide/components/intents-filters.html#Resolution"
|
startActivityForResult()} and pass it an implicit intent, the system
|
||||||
>resolves the intent</a> to an app that can handle the intent
|
<a href="{@docRoot}guide/components/intents-filters.html#Resolution">resolves
|
||||||
and starts its corresponding {@link android.app.Activity}. If there's more than one app
|
the intent</a> to an app that can handle the intent and starts its
|
||||||
that can handle the intent, the system presents the user with a dialog to pick which app
|
corresponding {@link android.app.Activity}. If there's more than one app
|
||||||
to use.</p>
|
that can handle the intent, the system presents the user with a dialog to
|
||||||
|
pick which app to use.
|
||||||
|
</p>
|
||||||
|
|
||||||
<p>This page describes several implicit intents that you can use to perform common actions,
|
<p>
|
||||||
organized by the type of app that handles the intent. Each section also shows how you can
|
This page describes several implicit intents that you can use to perform
|
||||||
create an <a href="{@docRoot}guide/components/intents-filters.html#Receiving">intent filter</a> to
|
common actions, organized by the type of app that handles the intent. Each
|
||||||
advertise your app's ability to perform the same action.</p>
|
section also shows how you can create an <a href=
|
||||||
|
"{@docRoot}guide/components/intents-filters.html#Receiving">intent
|
||||||
<p class="caution"><strong>Caution:</strong> If there are no apps on the device that can receive
|
filter</a> to advertise your app's ability to perform the same action.
|
||||||
the implicit intent, your app will crash when it calls {@link android.content.Context#startActivity
|
</p>
|
||||||
startActivity()}. To first verify that an app exists to receive the intent, call {@link
|
|
||||||
android.content.Intent#resolveActivity resolveActivity()} on your {@link android.content.Intent}
|
|
||||||
object. If the result is non-null, there is at least one app that can handle the intent and
|
|
||||||
it's safe to call {@link android.content.Context#startActivity startActivity()}. If the result is
|
|
||||||
null, you should not use the intent and, if possible, you should disable the feature that invokes
|
|
||||||
the intent.</p>
|
|
||||||
|
|
||||||
<p>If you're not familiar with how to create intents or intent filters, you should first read
|
|
||||||
<a href="{@docRoot}guide/components/intents-filters.html">Intents and Intent Filters</a>.</p>
|
|
||||||
|
|
||||||
<p>To learn how to fire the intents listed on this page from your development host, see
|
|
||||||
<a href="#AdbIntents">Verify Intents with the Android Debug Bridge</a>.</p>
|
|
||||||
|
|
||||||
<h4>Google Now</h4>
|
|
||||||
|
|
||||||
<p><a href="http://www.google.com/landing/now/">Google Now</a> fires some of the intents listed
|
|
||||||
on this page in response to voice commands. For more information, see
|
|
||||||
<a href="#Now">Intents Fired by Google Now</a>.</p>
|
|
||||||
|
|
||||||
|
<p class="caution">
|
||||||
|
<strong>Caution:</strong> If there are no apps on the device that can
|
||||||
|
receive the implicit intent, your app will crash when it calls {@link
|
||||||
|
android.content.Context#startActivity startActivity()}. To first verify that
|
||||||
|
an app exists to receive the intent, call {@link
|
||||||
|
android.content.Intent#resolveActivity resolveActivity()} on your {@link
|
||||||
|
android.content.Intent} object. If the result is non-null, there is at least
|
||||||
|
one app that can handle the intent and it's safe to call {@link
|
||||||
|
android.content.Context#startActivity startActivity()}. If the result is
|
||||||
|
null, you should not use the intent and, if possible, you should disable the
|
||||||
|
feature that invokes the intent.
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
If you're not familiar with how to create intents or intent filters, you
|
||||||
|
should first read <a href=
|
||||||
|
"{@docRoot}guide/components/intents-filters.html">Intents and Intent
|
||||||
|
Filters</a>.
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
To learn how to fire the intents listed on this page from your development
|
||||||
|
host, see <a href="#AdbIntents">Verify Intents with the Android Debug
|
||||||
|
Bridge</a>.
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<h4>Google Voice Actions</h4>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
<a href="https://developers.google.com/voice-actions/">Google Voice
|
||||||
|
Actions</a> fires some of the intents listed on this page in response to
|
||||||
|
voice commands. For more information, see <a href=
|
||||||
|
"https://developers.google.com/voice-actions/system/#system_actions_reference">
|
||||||
|
Intents fired by Google Voice Actions</a>.
|
||||||
|
</p>
|
||||||
|
|
||||||
<h2 id="Clock">Alarm Clock</h2>
|
<h2 id="Clock">Alarm Clock</h2>
|
||||||
|
|
||||||
|
|
||||||
<h3 id="CreateAlarm">Create an alarm</h3>
|
<h3 id="CreateAlarm">Create an alarm</h3>
|
||||||
|
|
||||||
<!-- Google Now box -->
|
<!-- Google Voice Actions box -->
|
||||||
<div class="now-box">
|
<div class="voice-box">
|
||||||
<div class="now-img-cont">
|
<div class="voice-img-cont">
|
||||||
<a href="#Now">
|
<a href=
|
||||||
<img src="{@docRoot}guide/components/images/voice-icon.png" class="now-img" width="30"
|
"https://developers.google.com/voice-actions/system/#system_actions_reference">
|
||||||
height="30" alt=""/>
|
<img src="{@docRoot}guide/components/images/voice-icon.png" class=
|
||||||
</a>
|
"voice-img" width="30" height="30" alt=""></a>
|
||||||
</div>
|
</div>
|
||||||
<p class="now-title">Google Now</p>
|
|
||||||
|
<p class="voice-title">
|
||||||
|
Google Voice Actions
|
||||||
|
</p>
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
<li>"set an alarm for 7 am"</li>
|
<li>"set an alarm for 7 am"
|
||||||
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -301,22 +321,30 @@ android.provider.AlarmClock#ACTION_SET_ALARM} intent, your app must have the
|
|||||||
|
|
||||||
<h3 id="CreateTimer">Create a timer</h3>
|
<h3 id="CreateTimer">Create a timer</h3>
|
||||||
|
|
||||||
<!-- Google Now box -->
|
<!-- Google Voice Actions box -->
|
||||||
<div class="now-box">
|
<div class="voice-box">
|
||||||
<div class="now-img-cont">
|
<div class="voice-img-cont">
|
||||||
<a href="#Now">
|
<a href=
|
||||||
<img src="{@docRoot}guide/components/images/voice-icon.png" class="now-img"
|
"https://developers.google.com/voice-actions/system/#system_actions_reference">
|
||||||
width="30" height="30" alt=""/>
|
<img src="{@docRoot}guide/components/images/voice-icon.png" class=
|
||||||
</a>
|
"voice-img" width="30" height="30" alt=""></a>
|
||||||
</div>
|
</div>
|
||||||
<p class="now-title">Google Now</p>
|
|
||||||
|
<p class="voice-title">
|
||||||
|
Google Voice Actions
|
||||||
|
</p>
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
<li>"set timer for 5 minutes"</li>
|
<li>"set timer for 5 minutes"
|
||||||
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<p>To create a countdown timer, use the {@link android.provider.AlarmClock#ACTION_SET_TIMER}
|
<p>
|
||||||
action and specify timer details such as the duration using extras defined below.</p>
|
To create a countdown timer, use the {@link
|
||||||
|
android.provider.AlarmClock#ACTION_SET_TIMER} action and specify timer
|
||||||
|
details such as the duration using extras defined below.
|
||||||
|
</p>
|
||||||
|
|
||||||
<p class="note"><strong>Note:</strong> This intent was added
|
<p class="note"><strong>Note:</strong> This intent was added
|
||||||
in Android 4.4 (API level 19).</p>
|
in Android 4.4 (API level 19).</p>
|
||||||
@@ -594,28 +622,36 @@ how to create an appropriate {@link android.net.Uri} for the output location, re
|
|||||||
</activity>
|
</activity>
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<p>When handling this intent, your activity should check for the {@link
|
<p>
|
||||||
android.provider.MediaStore#EXTRA_OUTPUT} extra in the incoming {@link android.content.Intent},
|
When handling this intent, your activity should check for the {@link
|
||||||
then save the captured image or video at the location specified by that extra and call {@link
|
android.provider.MediaStore#EXTRA_OUTPUT} extra in the incoming {@link
|
||||||
android.app.Activity#setResult(int,Intent) setResult()} with an
|
android.content.Intent}, then save the captured image or video at the
|
||||||
{@link android.content.Intent} that includes a compressed thumbnail
|
location specified by that extra and call {@link
|
||||||
in an extra named <code>"data"</code>.</p>
|
android.app.Activity#setResult(int,Intent) setResult()} with an {@link
|
||||||
|
android.content.Intent} that includes a compressed thumbnail in an extra
|
||||||
|
named <code>"data"</code>.
|
||||||
|
</p>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<h3 id="CameraStill">Start a camera app in still image mode</h3>
|
<h3 id="CameraStill">Start a camera app in still image mode</h3>
|
||||||
|
|
||||||
<!-- Google Now box -->
|
<!-- Google Voice Actions box -->
|
||||||
<div class="now-box">
|
<div class="voice-box">
|
||||||
<div class="now-img-cont">
|
<div class="voice-img-cont">
|
||||||
<a href="#Now">
|
<a href=
|
||||||
<img src="{@docRoot}guide/components/images/voice-icon.png" class="now-img"
|
"https://developers.google.com/voice-actions/system/#system_actions_reference">
|
||||||
width="30" height="30" alt=""/>
|
<img src="{@docRoot}guide/components/images/voice-icon.png" class=
|
||||||
</a>
|
"voice-img" width="30" height="30" alt=""></a>
|
||||||
</div>
|
</div>
|
||||||
<p class="now-title">Google Now</p>
|
|
||||||
|
<p class="voice-title">
|
||||||
|
Google Voice Actions
|
||||||
|
</p>
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
<li>"take a picture"</li>
|
<li>"take a picture"
|
||||||
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -661,17 +697,22 @@ public void capturePhoto() {
|
|||||||
|
|
||||||
<h3 id="CameraVideo">Start a camera app in video mode</h3>
|
<h3 id="CameraVideo">Start a camera app in video mode</h3>
|
||||||
|
|
||||||
<!-- Google Now box -->
|
<!-- Google Voice Actions box -->
|
||||||
<div class="now-box">
|
<div class="voice-box">
|
||||||
<div class="now-img-cont">
|
<div class="voice-img-cont">
|
||||||
<a href="#Now">
|
<a href=
|
||||||
<img src="{@docRoot}guide/components/images/voice-icon.png" class="now-img"
|
"https://developers.google.com/voice-actions/system/#system_actions_reference">
|
||||||
width="30" height="30" alt=""/>
|
<img src="{@docRoot}guide/components/images/voice-icon.png" class=
|
||||||
</a>
|
"voice-img" width="30" height="30" alt=""></a>
|
||||||
</div>
|
</div>
|
||||||
<p class="now-title">Google Now</p>
|
|
||||||
|
<p class="voice-title">
|
||||||
|
Google Voice Actions
|
||||||
|
</p>
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
<li>"record a video"</li>
|
<li>"record a video"
|
||||||
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -1348,20 +1389,30 @@ Framework</a> guide.</p>
|
|||||||
|
|
||||||
<h3 id="CallCar">Call a car</h3>
|
<h3 id="CallCar">Call a car</h3>
|
||||||
|
|
||||||
<!-- Google Now box -->
|
<!-- Google Voice Actions box -->
|
||||||
<div class="now-box">
|
<div class="voice-box">
|
||||||
<div class="now-img-cont">
|
<div class="voice-img-cont">
|
||||||
<a href="#Now">
|
<a href=
|
||||||
<img src="{@docRoot}guide/components/images/voice-icon.png" class="now-img"
|
"https://developers.google.com/voice-actions/system/#system_actions_reference">
|
||||||
width="30" height="30" alt=""/>
|
<img src="{@docRoot}guide/components/images/voice-icon.png" class=
|
||||||
</a>
|
"voice-img" width="30" height="30" alt=""></a>
|
||||||
</div>
|
</div>
|
||||||
<p class="now-title">Google Now</p>
|
|
||||||
|
<p class="voice-title">
|
||||||
|
Google Voice Actions
|
||||||
|
</p>
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
<li>"get me a taxi"</li>
|
<li>"get me a taxi"
|
||||||
<li>"call me a car"</li>
|
</li>
|
||||||
|
|
||||||
|
<li>"call me a car"
|
||||||
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<p style="font-size:13px;margin-bottom:0px;margin-top:10px">(Android Wear only)</p>
|
|
||||||
|
<p style="font-size:13px;margin-bottom:0px;margin-top:10px">
|
||||||
|
(Android Wear only)
|
||||||
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<p>To call a taxi, use the
|
<p>To call a taxi, use the
|
||||||
@@ -1548,17 +1599,22 @@ public void playMedia(Uri file) {
|
|||||||
|
|
||||||
<h3 id="PlaySearch">Play music based on a search query</h3>
|
<h3 id="PlaySearch">Play music based on a search query</h3>
|
||||||
|
|
||||||
<!-- Google Now box -->
|
<!-- Google Voice Actions box -->
|
||||||
<div class="now-box">
|
<div class="voice-box">
|
||||||
<div class="now-img-cont">
|
<div class="voice-img-cont">
|
||||||
<a href="#Now">
|
<a href=
|
||||||
<img src="{@docRoot}guide/components/images/voice-icon.png" class="now-img"
|
"https://developers.google.com/voice-actions/system/#system_actions_reference">
|
||||||
width="30" height="30" alt=""/>
|
<img src="{@docRoot}guide/components/images/voice-icon.png" class=
|
||||||
</a>
|
"voice-img" width="30" height="30" alt=""></a>
|
||||||
</div>
|
</div>
|
||||||
<p class="now-title">Google Now</p>
|
|
||||||
|
<p class="voice-title">
|
||||||
|
Google Voice Actions
|
||||||
|
</p>
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
<li>"play michael jackson billie jean"</li>
|
<li>"play michael jackson billie jean"
|
||||||
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -1861,19 +1917,28 @@ android.content.Intent#ACTION_DIAL} action and specify a phone number using
|
|||||||
the URI scheme defined below. When the phone app opens, it displays the phone number
|
the URI scheme defined below. When the phone app opens, it displays the phone number
|
||||||
but the user must press the <em>Call</em> button to begin the phone call.</p>
|
but the user must press the <em>Call</em> button to begin the phone call.</p>
|
||||||
|
|
||||||
<!-- Google Now box -->
|
<!-- Google Voice Actions box -->
|
||||||
<div class="now-box">
|
<div class="voice-box">
|
||||||
<div class="now-img-cont">
|
<div class="voice-img-cont">
|
||||||
<a href="#Now">
|
<a href=
|
||||||
<img src="{@docRoot}guide/components/images/voice-icon.png" class="now-img"
|
"https://developers.google.com/voice-actions/system/#system_actions_reference">
|
||||||
width="30" height="30" alt=""/>
|
<img src="{@docRoot}guide/components/images/voice-icon.png" class=
|
||||||
</a>
|
"voice-img" width="30" height="30" alt=""></a>
|
||||||
</div>
|
</div>
|
||||||
<p class="now-title">Google Now</p>
|
|
||||||
|
<p class="voice-title">
|
||||||
|
Google Voice Actions
|
||||||
|
</p>
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
<li>"call 555-5555"</li>
|
<li>"call 555-5555"
|
||||||
<li>"call bob"</li>
|
</li>
|
||||||
<li>"call voicemail"</li>
|
|
||||||
|
<li>"call bob"
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li>"call voicemail"
|
||||||
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -1947,16 +2012,22 @@ public void dialPhoneNumber(String phoneNumber) {
|
|||||||
|
|
||||||
<h3 id="SearchOnApp">Search using a specific app</h3>
|
<h3 id="SearchOnApp">Search using a specific app</h3>
|
||||||
|
|
||||||
<!-- Google Now box -->
|
<!-- Google Voice Actions box -->
|
||||||
<div class="now-box">
|
<div class="voice-box">
|
||||||
<div class="now-img-cont">
|
<div class="voice-img-cont">
|
||||||
<a href="#Now">
|
<a href=
|
||||||
<img src="{@docRoot}guide/components/images/voice-icon.png" class="now-img"
|
"https://developers.google.com/voice-actions/system/#system_actions_reference">
|
||||||
width="30" height="30"/></a>
|
<img src="{@docRoot}guide/components/images/voice-icon.png" class=
|
||||||
|
"voice-img" width="30" height="30" alt=""></a>
|
||||||
</div>
|
</div>
|
||||||
<p class="now-title">Google Now</p>
|
|
||||||
|
<p class="voice-title">
|
||||||
|
Google Voice Actions
|
||||||
|
</p>
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
<li>"search for cat videos on myvideoapp"</li>
|
<li>"search for cat videos on myvideoapp"
|
||||||
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<!-- Video box -->
|
<!-- Video box -->
|
||||||
@@ -1976,7 +2047,7 @@ the <code>SEARCH_ACTION</code> action, as shown in the example intent filter bel
|
|||||||
<dd>
|
<dd>
|
||||||
<dl>
|
<dl>
|
||||||
<dt><code>"com.google.android.gms.actions.SEARCH_ACTION"</code></dt>
|
<dt><code>"com.google.android.gms.actions.SEARCH_ACTION"</code></dt>
|
||||||
<dd>Support search queries from Google Now.</dd>
|
<dd>Support search queries from Google Voice Actions.</dd>
|
||||||
</dl>
|
</dl>
|
||||||
</dd>
|
</dd>
|
||||||
|
|
||||||
@@ -2207,17 +2278,22 @@ at {@link android.provider.Telephony}.</p>
|
|||||||
|
|
||||||
<h3 id="ViewUrl">Load a web URL</h3>
|
<h3 id="ViewUrl">Load a web URL</h3>
|
||||||
|
|
||||||
<!-- Google Now box -->
|
<!-- Google Voice Actions box -->
|
||||||
<div class="now-box">
|
<div class="voice-box">
|
||||||
<div class="now-img-cont">
|
<div class="voice-img-cont">
|
||||||
<a href="#Now">
|
<a href=
|
||||||
<img src="{@docRoot}guide/components/images/voice-icon.png" class="now-img"
|
"https://developers.google.com/voice-actions/system/#system_actions_reference">
|
||||||
width="30" height="30" alt=""/>
|
<img src="{@docRoot}guide/components/images/voice-icon.png" class=
|
||||||
</a>
|
"voice-img" width="30" height="30" alt=""></a>
|
||||||
</div>
|
</div>
|
||||||
<p class="now-title">Google Now</p>
|
|
||||||
|
<p class="voice-title">
|
||||||
|
Google Voice Actions
|
||||||
|
</p>
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
<li>"open example.com"</li>
|
<li>"open example.com"
|
||||||
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -2308,127 +2384,3 @@ adb shell am start -a android.intent.action.DIAL \
|
|||||||
|
|
||||||
<p>For more information, see
|
<p>For more information, see
|
||||||
<a href="{@docRoot}tools/help/shell.html#am">ADB Shell Commands</a>.</p>
|
<a href="{@docRoot}tools/help/shell.html#am">ADB Shell Commands</a>.</p>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<h2 id="Now">Intents Fired by Google Now</h2>
|
|
||||||
|
|
||||||
<p><a href="http://www.google.com/landing/now/">Google Now</a> recognizes many voice commands
|
|
||||||
and fires intents for them. As such, users may launch your app with a Google Now voice command
|
|
||||||
if your app declares the corresponding intent filter. For example, if your app can
|
|
||||||
<a href="#CreateAlarm">set an alarm</a> and you add the corresponding intent filter to your
|
|
||||||
manifest file, Google Now lets users choose your app when they request to set an alarm, as
|
|
||||||
shown in figure 1.</p>
|
|
||||||
|
|
||||||
<img src="{@docRoot}guide/components/images/google-action.png"
|
|
||||||
srcset="{@docRoot}guide/components/images/google-action_2x.png 2x"
|
|
||||||
width="700" height="241" alt=""/>
|
|
||||||
<p class="img-caption"><strong>Figure 1.</strong> Google Now lets users choose from installed
|
|
||||||
apps that support a given action.</p>
|
|
||||||
|
|
||||||
<p>Google Now recognizes voice commands for the actions listed in table 1. For more information
|
|
||||||
about declaring each intent filter, click on the action description.</p>
|
|
||||||
|
|
||||||
<p class="table-caption"><strong>Table 1.</strong> Voice commands recognized by Google Now
|
|
||||||
(Google Search app v3.6).</p>
|
|
||||||
<table>
|
|
||||||
<tr>
|
|
||||||
<th>Category</th>
|
|
||||||
<th>Details and Examples</th>
|
|
||||||
<th>Action Name</th>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td rowspan="2" style="vertical-align:middle">Alarm</td>
|
|
||||||
<td>
|
|
||||||
<p><a href="#CreateAlarm">Set alarm</a></p>
|
|
||||||
<ul class="now-list">
|
|
||||||
<li>"set an alarm for 7 am"</li>
|
|
||||||
</ul>
|
|
||||||
</td>
|
|
||||||
<td>{@link android.provider.AlarmClock#ACTION_SET_ALARM AlarmClock.ACTION_SET_ALARM}</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>
|
|
||||||
<p><a href="#CreateTimer">Set timer</a></p>
|
|
||||||
<ul class="now-list">
|
|
||||||
<li>"set a timer for 5 minutes"</li>
|
|
||||||
</ul>
|
|
||||||
</td>
|
|
||||||
<td>{@link android.provider.AlarmClock#ACTION_SET_TIMER AlarmClock.ACTION_SET_TIMER}</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td style="vertical-align:middle">Communication</td>
|
|
||||||
<td>
|
|
||||||
<p><a href="#DialPhone">Call a number</a></p>
|
|
||||||
<ul class="now-list">
|
|
||||||
<li>"call 555-5555"</li>
|
|
||||||
<li>"call bob"</li>
|
|
||||||
<li>"call voicemail"</li>
|
|
||||||
</ul>
|
|
||||||
</td>
|
|
||||||
<td>{@link android.content.Intent#ACTION_CALL Intent.ACTION_CALL}</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td style="vertical-align:middle">Local</td>
|
|
||||||
<td>
|
|
||||||
<p><a href="#CallCar">Book a car</a></p>
|
|
||||||
<ul class="now-list">
|
|
||||||
<li>"call me a car"</li>
|
|
||||||
<li>"book me a taxi"</li>
|
|
||||||
</ul>
|
|
||||||
</td>
|
|
||||||
<td><a href="{@docRoot}reference/com/google/android/gms/actions/ReserveIntents.html#ACTION_RESERVE_TAXI_RESERVATION">
|
|
||||||
<code>ReserveIntents<br/>.ACTION_RESERVE_TAXI_RESERVATION</code></a></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td rowspan="3" style="vertical-align:middle">Media</td>
|
|
||||||
<td>
|
|
||||||
<p><a href="#PlaySearch">Play music from search</a></p>
|
|
||||||
<ul class="now-list">
|
|
||||||
<li>"play michael jackson billie jean"</li>
|
|
||||||
</ul>
|
|
||||||
</td>
|
|
||||||
<td>{@link android.provider.MediaStore#INTENT_ACTION_MEDIA_PLAY_FROM_SEARCH MediaStore<br/>.INTENT_ACTION_MEDIA_PLAY_FROM_SEARCH}</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>
|
|
||||||
<p><a href="#CameraStill">Take a picture</a></p>
|
|
||||||
<ul class="now-list">
|
|
||||||
<li>"take a picture"</li>
|
|
||||||
</ul>
|
|
||||||
</td>
|
|
||||||
<td>{@link android.provider.MediaStore#INTENT_ACTION_STILL_IMAGE_CAMERA MediaStore<br/>.INTENT_ACTION_STILL_IMAGE_CAMERA}</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>
|
|
||||||
<p><a href="#CameraVideo">Record a video</a></p>
|
|
||||||
<ul class="now-list">
|
|
||||||
<li>"record a video"</li>
|
|
||||||
</ul>
|
|
||||||
</td>
|
|
||||||
<td>{@link android.provider.MediaStore#INTENT_ACTION_VIDEO_CAMERA MediaStore<br/>.INTENT_ACTION_VIDEO_CAMERA}</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td style="vertical-align:middle">Search</td>
|
|
||||||
<td>
|
|
||||||
<p><a href="#SearchOnApp">Search using a specific app</a></p>
|
|
||||||
<ul class="now-list">
|
|
||||||
<li>"search for cat videos <br/>on myvideoapp"</li>
|
|
||||||
</ul>
|
|
||||||
</td>
|
|
||||||
<td><code>"com.google.android.gms.actions<br/>.SEARCH_ACTION"</code></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td style="vertical-align:middle">Web browser</td>
|
|
||||||
<td>
|
|
||||||
<p><a href="#ViewUrl">Open URL</a></p>
|
|
||||||
<ul class="now-list">
|
|
||||||
<li>"open example.com"</li>
|
|
||||||
</ul>
|
|
||||||
</td>
|
|
||||||
<td>{@link android.content.Intent#ACTION_VIEW Intent.ACTION_VIEW}</td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
|
|||||||
Reference in New Issue
Block a user