* commit 'df881ccc1fe5efefa4a71cf8e5f663f9e2911151': docs: Fix Wear docs issues.
This commit is contained in:
@@ -112,7 +112,7 @@ Project</a>. As you follow the wizard, enter the following information:</p>
|
||||
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>
|
||||
|
||||
@@ -119,7 +119,7 @@ named <code>MyNoteActivity</code>:
|
||||
<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>
|
||||
@@ -244,7 +244,7 @@ from users and then process it, such as doing a search or sending it as a messag
|
||||
|
||||
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;
|
||||
|
||||
@@ -102,12 +102,12 @@ so the handheld app doesn't listen for any data events from the wearable app.</p
|
||||
<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>
|
||||
@@ -174,7 +174,7 @@ public class DataLayerListenerService extends WearableListenerService {
|
||||
}
|
||||
}
|
||||
}
|
||||
</pre>
|
||||
</pre>
|
||||
|
||||
<p>Here's the corresponding intent filter in the Android manifest file:</p>
|
||||
|
||||
|
||||
@@ -95,5 +95,5 @@ public void onMessageReceived(MessageEvent messageEvent) {
|
||||
<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>
|
||||
@@ -33,7 +33,15 @@ that use custom card layouts by creating a wearable app that runs on the wearabl
|
||||
</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;
|
||||
@@ -190,7 +198,7 @@ bigStyle.bigText(eventDescription);
|
||||
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)
|
||||
|
||||
Reference in New Issue
Block a user