name.</li>
<li>In the <b>Form Factors</b> window:
<ul>
- <li>Select <b>Phone and Tablet</b> and select <b>API 8: Android 2.2 (Froyo)</b>
+ <li>Select <b>Phone and Tablet</b> and select <b>API 9: Android 2.3 (Gingerbread)</b>
under <b>Minimum SDK</b>.</li>
<li>Select <b>Wear</b> and select <b>API 20: Android 4.4 (KitKat Wear)</b>
under <b>Minimum SDK</b>.</li>
<td>
<dl>
<dt>Action</dt>
- <dd><code>android.provider.AlarmClock.ACTION_SET_TIMER</code></dd>
+ <dd><code>android.intent.action.SET_TIMER</code></dd>
<dt>Extras</dt>
<dd><code>android.provider.AlarmClock.EXTRA_LENGTH</code> - an integer in the range of
1 to 86400 (number of seconds in 24 hours) representing the length of the timer </dd>
In your app, you call {@link android.app.Activity#startActivityForResult startActivityForResult()} using
the {@link android.speech.RecognizerIntent#ACTION_RECOGNIZE_SPEECH} action. This starts the
- and then handle the result
+speech recognition activity, and you can then handle the result
in {@link android.app.Activity#onActivityResult onActivityResult()}.
<pre>
private static final int SPEECH_REQUEST_CODE = 0;
<ul>
<li><a href="{@docRoot}reference/com/google/android/gms/wearable/WearableListenerService.html#onDataChanged(com.google.android.gms.wearable.DataEventBuffer)"><code>onDataChanged()</code></a>
- Called when data item objects are created, changed, or deleted. An event on one side of a connection
-triggers an this callback on both sides.</li>
+triggers this callback on both sides.</li>
<li><a href="{@docRoot}reference/com/google/android/gms/wearable/WearableListenerService.html#onMessageReceived(com.google.android.gms.wearable.MessageEvent)"><code>onMessageReceived()</code></a>
- A message sent from one side of a connection triggers this callback on the other side of the connection.</li>
<li><a href="{@docRoot}reference/com/google/android/gms/wearable/WearableListenerService.html#onMessageReceived(com.google.android.gms.wearable.MessageEvent)"><code>onPeerConnected()</code></a>
and <a href="{@docRoot}reference/com/google/android/gms/wearable/WearableListenerService.html#onPeerDisconnected(com.google.android.gms.wearable.Node)"><code>onPeerDisconnected()</code></a> -
- Called when connection with the handheld or wearable is connected or disconnected.
+ Called when connection with the handheld or wearable is connected or disconnected.
Changes in connection state on one side of the connection triggers these callbacks on both sides of the connection.
</li>
</ul>
}
}
}
-</pre>
+</pre>
<p>Here's the corresponding intent filter in the Android manifest file:</p>
<p>
This is just a snippet that requires more implementation details. Learn about
how to implement a full listener service or activity in
-<a href="#listening">Listening for Data Layer Events</a>.
+<a href="{@docRoot}training/wearables/data-layer/events.html">Listening for Data Layer Events</a>.
</p>
\ No newline at end of file
</div>
<h2 id="Import">Import the necessary classes</h2>
-<p>Before you begin, import the necessary classes from the support library:</p>
+
+<p>To import the necessary packages, add this line to your <code>build.gradle</code>file:</p>
+
+<pre>
+compile "com.android.support:support-v4:20.0.+"
+</pre>
+
+<p>Now that your project has access to the necessary packages, import the necessary classes from
+the support library:</p>
<pre style="clear:right">
import android.support.v4.app.NotificationCompat;
NotificationCompat.Builder notificationBuilder =
new NotificationCompat.Builder(this)
.setSmallIcon(R.drawable.ic_event)
- .setLargeIcon(BitmapFractory.decodeResource(
+ .setLargeIcon(BitmapFactory.decodeResource(
getResources(), R.drawable.notif_background))
.setContentTitle(eventTitle)
.setContentText(eventLocation)