summaryrefslogtreecommitdiffstats
path: root/docs/html
diff options
context:
space:
mode:
Diffstat (limited to 'docs/html')
-rw-r--r--docs/html/guide/appendix/media-formats.jd137
-rw-r--r--docs/html/guide/guide_toc.cs18
-rw-r--r--docs/html/guide/topics/resources/more-resources.jd2
-rw-r--r--docs/html/guide/topics/ui/notifiers/notifications.jd357
-rw-r--r--docs/html/guide/topics/usb/adk.jd9
-rwxr-xr-xdocs/html/images/custom_message.pngbin11120 -> 17871 bytes
-rw-r--r--docs/html/resources/articles/speech-input.jd4
-rw-r--r--docs/html/resources/resources-data.js39
-rw-r--r--docs/html/sdk/android-3.2.jd4
-rw-r--r--docs/html/sdk/index.jd24
-rw-r--r--docs/html/sdk/sdk_toc.cs11
-rw-r--r--docs/html/sdk/tools-notes.jd47
12 files changed, 405 insertions, 247 deletions
diff --git a/docs/html/guide/appendix/media-formats.jd b/docs/html/guide/appendix/media-formats.jd
index e128a1c..ccc63a2 100644
--- a/docs/html/guide/appendix/media-formats.jd
+++ b/docs/html/guide/appendix/media-formats.jd
@@ -37,11 +37,16 @@ page.title=Android Supported Media Formats
<ul>
<li>RTSP (RTP, SDP)</li>
- <li>HTTP progressive streaming</li>
- <li>HTTP live streaming <a href="http://tools.ietf.org/html/draft-pantos-http-live-streaming-05">draft protocol</a> (Android 3.0 and above)</li>
+ <li>HTTP/HTTPS progressive streaming</li>
+ <li>HTTP/HTTPS live streaming <a href="http://tools.ietf.org/html/draft-pantos-http-live-streaming">draft protocol</a>: <ul>
+ <li>MPEG-2 TS media files only</li>
+ <li>Protocol version 3 (Android 4.0 and above)</li>
+ <li>Protocol version 2 (Android 3.x)</li>
+ <li>Not supported before Android 3.0</li>
+ </ul></li>
</ul>
-<p class="note"><strong>Note:</strong> HTTPS is not supported at this time.</p>
+<p class="note"><strong>Note:</strong> HTTPS is not supported before Android 3.1.</p>
<h2 id="core">Core Media Formats</h2>
@@ -71,7 +76,11 @@ page.title=Android Supported Media Formats
<td style="text-align: center;"><big>&bull;</big></td>
<td rowspan="3">Mono/Stereo content in any combination of standard bit
rates up to 160 kbps and sampling rates from 8 to 48kHz</td>
-<td rowspan="3">3GPP (.3gp), and MPEG-4 (.mp4, .m4a). ADTS raw AAC (.aac, decode only, ADIF not supported, Android 3.1+). </td>
+<td rowspan="3">
+ &bull; 3GPP (.3gp)<br>
+ &bull; MPEG-4 (.mp4, .m4a)<br>
+ &bull; ADTS raw AAC (.aac, decode in Android 3.1+, encode in Android 4.0+, ADIF not supported)<br>
+ &bull; MPEG-TS (.ts, not seekable, Android 3.0+)</td>
</tr>
<tr>
@@ -91,8 +100,8 @@ rates up to 160 kbps and sampling rates from 8 to 48kHz</td>
<td style="text-align: center;"><big>&bull;</big></td>
<td style="text-align: center;"><big>&bull;</big></td>
<td>4.75 to 12.2 kbps sampled @ 8kHz</td>
-<td>3GPP (.3gp)
-</td>
+<td>
+ 3GPP (.3gp)</td>
</tr>
<tr>
@@ -100,19 +109,21 @@ rates up to 160 kbps and sampling rates from 8 to 48kHz</td>
<td style="text-align: center;"><big>&bull;</big></td>
<td style="text-align: center;"><big>&bull;</big></td>
<td>9 rates from 6.60 kbit/s to 23.85 kbit/s sampled @ 16kHz</td>
-<td>3GPP (.3gp)</td>
+<td>
+ 3GPP (.3gp)</td>
</tr>
<tr>
<td>FLAC</td>
<td>&nbsp;</td>
-<td style="text-align: center;"><big>&bull;</big><br><small>(Android 3.1+)</small></td>
+<td style="text-align: center;" nowrap><big>&bull;</big><br><small>(Android 3.1+)</small></td>
<td>Mono/Stereo (no multichannel). Sample rates up to 48 kHz (but up to 44.1
kHz is recommended on devices with 44.1 kHz output, as the 48 to 44.1 kHz
downsampler does not include a low-pass filter). 16-bit recommended;
no dither applied for 24-bit.
</td>
-<td>FLAC (.flac) only</td>
+<td>
+ FLAC (.flac) only</td>
</tr>
<tr>
@@ -121,7 +132,8 @@ no dither applied for 24-bit.
<td style="text-align: center;"><big>&bull;</big></td>
<td>Mono/Stereo 8-320Kbps constant (CBR) or variable bit-rate (VBR)
</td>
-<td>MP3 (.mp3)</td>
+<td>
+ MP3 (.mp3)</td>
</tr>
<tr>
@@ -129,15 +141,21 @@ no dither applied for 24-bit.
<td>&nbsp;</td>
<td style="text-align: center;"><big>&bull;</big></td>
<td>MIDI Type 0 and 1. DLS Version 1 and 2. XMF and Mobile XMF. Support for ringtone formats RTTTL/RTX, OTA, and iMelody </td>
-<td>Type 0 and 1 (.mid, .xmf, .mxmf). Also RTTTL/RTX (.rtttl, .rtx), OTA (.ota), and iMelody (.imy)</td>
+<td>
+ &bull; Type 0 and 1 (.mid, .xmf, .mxmf)<br>
+ &bull; RTTTL/RTX (.rtttl, .rtx)<br>
+ &bull; OTA (.ota)<br>
+ &bull; iMelody (.imy)</td>
</tr>
<tr>
-<td>Ogg Vorbis</td>
+<td>Vorbis</td>
<td>&nbsp;</td>
<td style="text-align: center;"><big>&bull;</big></td>
<td>&nbsp;</td>
-<td>Ogg (.ogg)</td>
+<td>
+ &bull; Ogg (.ogg)<br>
+ &bull; Matroska (.mkv, Android 4.0+)</td>
</tr>
<tr>
@@ -145,16 +163,18 @@ no dither applied for 24-bit.
<td>&nbsp;</td>
<td style="text-align: center;"><big>&bull;</big></td>
<td>8- and 16-bit linear PCM (rates up to limit of hardware)</td>
-<td>WAVE (.wav)</td>
+<td>
+ WAVE (.wav)</td>
</tr>
<tr>
-<td rowspan="4">Image</td>
+<td rowspan="5">Image</td>
<td>JPEG</td>
<td style="text-align: center;"><big>&bull;</big></td>
<td style="text-align: center;"><big>&bull;</big></td>
<td>Base+progressive</td>
-<td>JPEG (.jpg)</td>
+<td>
+ JPEG (.jpg)</td>
</tr>
<tr>
@@ -162,7 +182,8 @@ no dither applied for 24-bit.
<td>&nbsp;</td>
<td style="text-align: center;"><big>&bull;</big></td>
<td>&nbsp;</td>
-<td>GIF (.gif)</td>
+<td>
+ GIF (.gif)</td>
</tr>
<tr>
@@ -170,7 +191,8 @@ no dither applied for 24-bit.
<td style="text-align: center;"><big>&bull;</big></td>
<td style="text-align: center;"><big>&bull;</big></td>
<td>&nbsp;</td>
-<td>PNG (.png)</td>
+<td>
+ PNG (.png)</td>
</tr>
<tr>
@@ -178,7 +200,17 @@ no dither applied for 24-bit.
<td>&nbsp;</td>
<td style="text-align: center;"><big>&bull;</big></td>
<td>&nbsp;</td>
-<td>BMP (.bmp)</td>
+<td>
+ BMP (.bmp)</td>
+</tr>
+
+<tr>
+<td>WEBP</td>
+<td style="text-align: center;" nowrap><big>&bull;</big><br><small>(Android 4.0+)</small></td>
+<td style="text-align: center;" nowrap><big>&bull;</big><br><small>(Android 4.0+)</small></td>
+<td>&nbsp;</td>
+<td>
+ WebP (.webp)</td>
</tr>
@@ -188,15 +220,20 @@ no dither applied for 24-bit.
<td style="text-align: center;"><big>&bull;</big></td>
<td style="text-align: center;"><big>&bull;</big></td>
<td>&nbsp;</td>
-<td>3GPP (.3gp) and MPEG-4 (.mp4)</td>
+<td>
+ &bull; 3GPP (.3gp)<br>
+ &bull; MPEG-4 (.mp4)</td>
</tr>
<tr>
<td>H.264 AVC</td>
<td style="text-align: center;" nowrap><big>&bull;</big><br><small>(Android 3.0+)</small></td>
-<td style="text-align: center;"><big>&bull;</big></td>
+<td style="text-align: center;" nowrap><big>&bull;</big></td>
<td>Baseline Profile (BP)</td>
-<td>3GPP (.3gp) and MPEG-4 (.mp4). MPEG-TS (.ts, AAC audio only, not seekable, Android 3.0+)</td>
+<td>
+ &bull; 3GPP (.3gp)<br>
+ &bull; MPEG-4 (.mp4)<br>
+ &bull; MPEG-TS (.ts, AAC audio only, not seekable, Android 3.0+)</td>
</tr>
<tr>
@@ -204,15 +241,18 @@ no dither applied for 24-bit.
<td>&nbsp;</td>
<td style="text-align: center;"><big>&bull;</big></td>
<td>&nbsp;</td>
-<td>3GPP (.3gp)</td>
+<td>
+ 3GPP (.3gp)</td>
</tr>
<tr>
<td>VP8</td>
<td>&nbsp;</td>
-<td style="text-align: center;"><big>&bull;</big><br><small>(Android 2.3.3+)</small></td>
-<td>&nbsp;</td>
-<td><a href="http://www.webmproject.org/">WebM</a> (.webm)</td>
+<td style="text-align: center;" nowrap><big>&bull;</big><br><small>(Android 2.3.3+)</small></td>
+<td>Streamable only in Android 4.0 and above</td>
+<td>
+ &bull; <a href="http://www.webmproject.org/">WebM</a> (.webm)<br>
+ &bull; Matroska (.mkv, Android 4.0+)</td>
</tr>
</tbody></table>
@@ -220,7 +260,7 @@ no dither applied for 24-bit.
<h2 id="recommendations">Video Encoding Recommendations</h2>
-<p>Table 2, below, lists examples of video encoding profiles and parameters that the Android media framework supports for playback. In addition to these encoding parameter recommendations, a device's available video recording profiles can be used as a proxy for media playback capabilities. These profiles can be inspected using the {@link android.media.CamcorderProfile CamcorderProfile} class, which is available since API level 8.</p>
+<p>Table 2, below, lists examples of video encoding profiles and parameters that the Android media framework supports for playback. In addition to these encoding parameter recommendations, a device's available <em>video recording</em> profiles can be used as a proxy for media playback capabilities. These profiles can be inspected using the {@link android.media.CamcorderProfile CamcorderProfile} class, which is available since API level 8.</p>
<p class="table-caption" id="encoding-recommendations-table"><strong>Table 2.</strong> Examples of supported video encoding parameters.</p>
@@ -228,45 +268,53 @@ no dither applied for 24-bit.
<thead>
<tr>
<th>&nbsp;</th>
- <th style="background-color:#f3f3f3;font-weight:normal">Lower quality</th>
- <th style="background-color:#f3f3f3;font-weight:normal">Higher quality</th>
+ <th style="background-color:#f3f3f3;font-weight:normal"><acronym title="Standard definition">SD</a> (Low quality)</th>
+ <th style="background-color:#f3f3f3;font-weight:normal"><acronym title="Standard definition">SD</a> (High quality)</th>
+ <th style="background-color:#f3f3f3;font-weight:normal"><acronym title="High definition">HD</a> (Not available on all devices)</th>
</tr>
</thead>
<tbody>
<tr>
<th>Video codec</th>
- <td>H.264 Baseline Profile</th>
- <td>H.264 Baseline Profile</th>
+ <td>H.264 Baseline Profile</td>
+ <td>H.264 Baseline Profile</td>
+ <td>H.264 Baseline Profile</td>
</tr>
<tr>
<th>Video resolution</th>
- <td>176 x 144 px</th>
- <td>480 x 360 px</th>
+ <td>176 x 144 px</td>
+ <td>480 x 360 px</td>
+ <td>1280 x 720 px</td>
</tr>
<tr>
<th>Video frame rate</th>
- <td>12 fps</th>
- <td>30 fps</th>
+ <td>12 fps</td>
+ <td>30 fps</td>
+ <td>30 fps</td>
</tr>
<tr>
<th>Video bitrate</th>
- <td>56 Kbps</th>
- <td>500 Kbps</th>
+ <td>56 Kbps</td>
+ <td>500 Kbps</td>
+ <td>2 Mbps</td>
</tr>
<tr>
<th>Audio codec</th>
- <td>AAC-LC</th>
- <td>AAC-LC</th>
+ <td>AAC-LC</td>
+ <td>AAC-LC</td>
+ <td>AAC-LC</td>
</tr>
<tr>
<th>Audio channels</th>
- <td>1 (mono)</th>
- <td>2 (stereo)</th>
+ <td>1 (mono)</td>
+ <td>2 (stereo)</td>
+ <td>2 (stereo)</td>
</tr>
<tr>
<th>Audio bitrate</th>
- <td>24 Kbps</th>
- <td>128 Kbps</th>
+ <td>24 Kbps</td>
+ <td>128 Kbps</td>
+ <td>192 Kbps</td>
</tr>
</tbody>
</table>
@@ -274,7 +322,8 @@ no dither applied for 24-bit.
<p style="margin-top: 2em">For video content that is streamed over HTTP or RTSP, there are additional requirements:</p>
<ul>
- <li>For 3GPP and MPEG-4 containers, the <code>moov</code> atom must precede any <code>mdat</code> atoms.</li>
+ <li>For 3GPP and MPEG-4 containers, the <code>moov</code> atom must precede any <code>mdat</code> atoms, but must succeed the
+ <code>ftyp</code> atom.</li>
<li>For 3GPP, MPEG-4, and WebM containers, audio and video samples corresponding to the same time offset may be no more than 500 KB apart.
To minimize this audio/video drift, consider interleaving audio and video in smaller chunk sizes.</li>
</ul>
diff --git a/docs/html/guide/guide_toc.cs b/docs/html/guide/guide_toc.cs
index 9c3a0be..3716583 100644
--- a/docs/html/guide/guide_toc.cs
+++ b/docs/html/guide/guide_toc.cs
@@ -222,8 +222,7 @@
<li><a href="<?cs var:toroot ?>guide/topics/manifest/receiver-element.html">&lt;receiver&gt;</a></li>
<li><a href="<?cs var:toroot ?>guide/topics/manifest/service-element.html">&lt;service&gt;</a></li>
<li><a href="<?cs var:toroot ?>guide/topics/manifest/supports-gl-texture-element.html">&lt;supports-gl-texture&gt;</a></li>
- <li><a href="<?cs var:toroot ?>guide/topics/manifest/supports-screens-element.html">&lt;supports-screens&gt;</a>
- <span class="new">updated</span></li> <!-- ##api level 4## -->
+ <li><a href="<?cs var:toroot ?>guide/topics/manifest/supports-screens-element.html">&lt;supports-screens&gt;</a></li><!-- ##api level 4## -->
<li><a href="<?cs var:toroot ?>guide/topics/manifest/uses-configuration-element.html">&lt;uses-configuration&gt;</a></li>
<li><a href="<?cs var:toroot ?>guide/topics/manifest/uses-feature-element.html">&lt;uses-feature&gt;</a></li> <!-- ##api level 4## -->
<li><a href="<?cs var:toroot ?>guide/topics/manifest/uses-library-element.html">&lt;uses-library&gt;</a></li>
@@ -244,7 +243,7 @@
</a></li>
<li><a href="<?cs var:toroot ?>guide/topics/graphics/opengl.html">
<span class="en">3D with OpenGL</span>
- </a><span class="new">updated</span></li>
+ </a></li>
<li><a href="<?cs var:toroot ?>guide/topics/graphics/animation.html">
<span class="en">Property Animation</span>
</a></li>
@@ -271,7 +270,7 @@
<li><a href="<?cs var:toroot ?>guide/topics/media/index.html">
<span class="en">Media</span>
- </a><span class="new">updated</span></li>
+ </a></li>
<li>
<a href="<?cs var:toroot ?>guide/topics/clipboard/copy-paste.html">
<span class="en">Copy and Paste</span>
@@ -408,7 +407,6 @@
</li>
<li><a href="<?cs var:toroot ?>guide/market/publishing/multiple-apks.html">
<span class="en">Multiple APK Support</span></a>
- <span class="new">new!</span>
</li>
</ul>
</li>
@@ -569,7 +567,7 @@
</a></div>
<ul>
<li><a href="<?cs var:toroot ?>guide/developing/tools/adb.html">adb</a></li>
- <li><a href="<?cs var:toroot ?>guide/developing/tools/adt.html">ADT</a> <span class="new">new!</span></li>
+ <li><a href="<?cs var:toroot ?>guide/developing/tools/adt.html">ADT</a></li>
<li><a href="<?cs var:toroot ?>guide/developing/tools/android.html">android</a></li>
<li><a href="<?cs var:toroot ?>guide/developing/tools/bmgr.html">bmgr</a>
<li><a href="<?cs var:toroot ?>guide/developing/tools/dmtracedump.html">dmtracedump</a></li>
@@ -672,14 +670,14 @@
<li class="toggle-list">
<div><a href="<?cs var:toroot ?>guide/practices/screens_support.html">
<span class="en">Supporting Multiple Screens</span>
- </a> <span class="new">updated</span></div>
+ </a></div>
<ul>
<li><a href="<?cs var:toroot ?>guide/practices/screens-distribution.html">
<span class="en">Distributing to Specific Screens</span>
</a></li>
<li><a href="<?cs var:toroot ?>guide/practices/screen-compat-mode.html">
<span class="en">Screen Compatibility Mode</span>
- </a> <span class="new">new!</span></li>
+ </a></li>
<li><a href="<?cs var:toroot ?>guide/practices/screens-support-1.5.html">
<span class="en">Strategies for Android 1.5</span>
</a></li>
@@ -737,11 +735,11 @@
<li class="toggle-list">
<div><a href="<?cs var:toroot ?>guide/practices/design/performance.html">
<span class="en">Designing for Performance</span>
- </a> <span class="new-child">new!</span></div>
+ </a></div>
<ul>
<li><a href="<?cs var:toroot ?>guide/practices/design/jni.html">
<span class="en">JNI Tips</span>
- </a> <span class="new">new!</span></li>
+ </a></li>
</ul>
</li>
<li><a href="<?cs var:toroot ?>guide/practices/design/responsiveness.html">
diff --git a/docs/html/guide/topics/resources/more-resources.jd b/docs/html/guide/topics/resources/more-resources.jd
index 5f4d5c2..972eab9 100644
--- a/docs/html/guide/topics/resources/more-resources.jd
+++ b/docs/html/guide/topics/resources/more-resources.jd
@@ -698,7 +698,7 @@ Resources res = {@link android.content.Context#getResources()};
TypedArray icons = res.{@link android.content.res.Resources#obtainTypedArray(int) obtainTypedArray}(R.array.icons);
Drawable drawable = icons.{@link android.content.res.TypedArray#getDrawable(int) getDrawable}(0);
-TypedArray colors = res.{@link android.content.res.Resources#obtainTypedArray(int) obtainTypedArray}(R.array.icons);
+TypedArray colors = res.{@link android.content.res.Resources#obtainTypedArray(int) obtainTypedArray}(R.array.colors);
int color = colors.{@link android.content.res.TypedArray#getColor(int,int) getColor}(0,0);
</pre>
</dd> <!-- end example -->
diff --git a/docs/html/guide/topics/ui/notifiers/notifications.jd b/docs/html/guide/topics/ui/notifiers/notifications.jd
index abc945a..f12c5ee 100644
--- a/docs/html/guide/topics/ui/notifiers/notifications.jd
+++ b/docs/html/guide/topics/ui/notifiers/notifications.jd
@@ -12,7 +12,7 @@ without interupting their current activity</li>
<li>You can attach an intent to your notification that the system will initiate when the
user clicks it</li>
</ul>
-
+
<h2>In this document</h2>
<ol>
<li><a href="#Basics">The Basics</a></li>
@@ -26,7 +26,7 @@ user clicks it</li>
<li><a href="#More">More features</a></li>
</ol>
</li>
- <li><a href="#CustomExpandedView">Creating a Custom Expanded View</a></li>
+ <li><a href="#CustomExpandedView">Creating a Custom Notification Layout</a></li>
</ol>
<h2>Key classes</h2>
<ol>
@@ -36,57 +36,63 @@ user clicks it</li>
</div>
</div>
-<p>A status bar notification adds an icon to the system's status bar
-(with an optional ticker-text message) and an expanded message in the "Notifications" window.
-When the user selects the expanded message, Android fires an
-{@link android.content.Intent} that is defined by the notification (usually to launch an
-{@link android.app.Activity}).
+<p>A status bar notification adds an icon to the system's status bar
+(with an optional ticker-text message) and a notification message in the notifications window.
+When the user selects the notification, Android fires an
+{@link android.content.Intent} that is defined by the {@link android.app.Notification} (usually to
+launch an {@link android.app.Activity}).
You can also configure the notification to alert the user with a sound, a vibration, and flashing
lights on the device.</p>
<p>A status bar notification should be used for any case in
-which a background Service needs to alert the user about an event that requires a response. A background Service
-<strong>should never</strong> launch an Activity on its own in order to receive user interaction.
-The Service should instead create a status bar notification that will launch the Activity
+which a background service needs to alert the user about an event that requires a response. A
+background service
+<strong>should never</strong> launch an activity on its own in order to receive user interaction.
+The service should instead create a status bar notification that will launch the activity
when selected by the user.</p>
-<p>The screenshot below shows the status bar with a notification icon on the left side.</p>
+<p>Figure 1 shows the status bar with a notification icon on the left side.</p>
<img src="{@docRoot}images/status_bar.png" alt="" />
+<p class="img-caption"><strong>Figure 1.</strong> Status bar with a notification.</p>
+
+<p>Figure 2 shows the notification's message in the notifications window.</p>
-<p>The next screenshot shows the notification's expanded message in the "Notifications" window.
-The user can reveal the Notifications window by pulling down the status bar
-(or selecting <em>Notifications</em> from the Home options menu).</p>
<img src="{@docRoot}images/notifications_window.png" alt="" />
+<p class="img-caption"><strong>Figure 2.</strong> The notifications window.</p>
<h2 id="Basics">The Basics</h2>
-<p>An {@link android.app.Activity} or {@link android.app.Service} can initiate a status bar
-notification. Because an Activity can perform actions only while it is
-active and in focus, you should create your status bar notifications from a
-Service. This way, the notification can be created from the background,
+<p>An {@link android.app.Activity} or {@link android.app.Service} can initiate a status bar
+notification. Because an activity can perform actions only while it is
+running in the foreground and its window has focus, you will usually create status bar notifications
+from a
+service. This way, the notification can be created from the background,
while the user is using another application or
while the device is asleep. To create a notification, you must use two
classes: {@link android.app.Notification} and {@link android.app.NotificationManager}.</p>
-<p>Use an instance of the {@link android.app.Notification} class to define the properties of your
-status bar notification, such as the status bar icon, the expanded message, and extra settings such
-as a sound to play. The {@link android.app.NotificationManager} is an Android system service that
-executes and manages all Notifications. You do not instantiate the NotificationManager. In order
-to give it your Notification, you must retrieve a reference to the NotificationManager with
-{@link android.app.Activity#getSystemService(String) getSystemService()} and
-then, when you want to notify the user, pass it your Notification object with
+<p>Use an instance of the {@link android.app.Notification} class to define the properties of your
+status bar notification, such as the status bar icon, the notification message, and extra settings
+such as a sound to play. The {@link android.app.NotificationManager} is an Android system service
+that executes and manages all status bar notifications. You do not instantiate the
+{@link android.app.NotificationManager} directly. In order
+to give it your {@link android.app.Notification}, you must retrieve a reference to the
+{@link android.app.NotificationManager} with
+{@link android.app.Activity#getSystemService(String) getSystemService()} and
+then, when you want to notify the user, pass it your {@link android.app.Notification} with
{@link android.app.NotificationManager#notify(int,Notification) notify()}. </p>
<p>To create a status bar notification:</p>
<ol>
- <li>Get a reference to the NotificationManager:
+ <li>Get a reference to the {@link android.app.NotificationManager}:
<pre>
String ns = Context.NOTIFICATION_SERVICE;
NotificationManager mNotificationManager = (NotificationManager) getSystemService(ns);
</pre>
</li>
- <li>Instantiate the Notification:
+ <!-- use Notification.Builder in 3.0 -->
+ <li>Instantiate the {@link android.app.Notification}:
<pre>
int icon = R.drawable.notification_icon;
CharSequence tickerText = "Hello";
@@ -95,7 +101,7 @@ long when = System.currentTimeMillis();
Notification notification = new Notification(icon, tickerText, when);
</pre>
</li>
- <li>Define the Notification's expanded message and Intent:
+ <li>Define the notification's message and {@link android.app.PendingIntent}:
<pre>
Context context = getApplicationContext();
CharSequence contentTitle = "My notification";
@@ -106,7 +112,7 @@ PendingIntent contentIntent = PendingIntent.getActivity(this, 0, notificationInt
notification.setLatestEventInfo(context, contentTitle, contentText, contentIntent);
</pre>
</li>
- <li>Pass the Notification to the NotificationManager:
+ <li>Pass the {@link android.app.Notification} to the {@link android.app.NotificationManager}:
<pre>
private static final int HELLO_ID = 1;
@@ -121,38 +127,41 @@ mNotificationManager.notify(HELLO_ID, notification);
<p>The {@link android.app.NotificationManager} is a system service that manages all
notifications. You must retrieve a reference to it with the
-{@link android.app.Activity#getSystemService(String) getSystemService()} method.
+{@link android.app.Activity#getSystemService(String) getSystemService()} method.
For example:</p>
<pre>
String ns = Context.NOTIFICATION_SERVICE;
NotificationManager mNotificationManager = (NotificationManager) getSystemService(ns);
</pre>
-<p>When you want to send your status bar notification, pass the Notification object
-to the NotificationManager with {@link android.app.NotificationManager#notify(int,Notification)}.
-The first parameter is the unique ID for the Notification and the second is the Notification object.
-The ID uniquely identifies the Notification from within your
-application. This is necessary if you need to update the Notification or (if
-your application manages different kinds of Notifications) select the appropriate action
-when the user returns to your application via the Intent defined in the Notification.</p>
+<p>When you want to deliver your status bar notification, pass the {@link android.app.Notification}
+to the {@link android.app.NotificationManager} with {@link
+android.app.NotificationManager#notify(int,Notification)}.
+The first parameter is the unique ID for the notification and the second is the {@link
+android.app.Notification} object.
+The ID uniquely identifies the notification from within your
+application. The ID is necessary if you need to update the notification or (if
+your application manages different kinds of notifications) select the appropriate action
+when the user returns to your application via the intent defined in the notification.</p>
-<p>To clear the status bar notification when the user selects it from the Notifications
-window, add the "FLAG_AUTO_CANCEL" flag to your Notification object. You can also clear it
-manually with {@link android.app.NotificationManager#cancel(int)}, passing it the notification ID,
-or clear all your Notifications with {@link android.app.NotificationManager#cancelAll()}.</p>
+<p>To clear the status bar notification when the user selects it from the notifications
+window, add the "FLAG_AUTO_CANCEL" flag to your {@link android.app.Notification}. You can
+also clear it manually with {@link android.app.NotificationManager#cancel(int)}, passing it the
+notification ID, or clear all your notifications with {@link
+android.app.NotificationManager#cancelAll()}.</p>
<h2 id="CreateANotification">Creating a Notification</h2>
<p>A {@link android.app.Notification} object defines the details of the notification
-message that is displayed in the status bar and "Notifications" window, and any other
+message that is displayed in the status bar and notifications window, and any other
alert settings, such as sounds and blinking lights.</p>
<p>A status bar notification <em>requires</em> all of the following:</p>
<ul>
<li>An icon for the status bar</li>
- <li>A title and expanded message for the expanded view (unless you define a
- <a href="#CustomExpandedView">custom expanded view</a>)</li>
+ <li>A title and message, unless you define a
+ <a href="#CustomExpandedView">custom notification layout</a></li>
<li>A {@link android.app.PendingIntent}, to be fired when the notification is selected</li>
</ul>
<p>Optional settings for the status bar notification include:</p>
@@ -163,18 +172,18 @@ alert settings, such as sounds and blinking lights.</p>
<li>A flashing LED setting</li>
</ul>
-<p>The starter-kit for a new Notification includes the
-{@link android.app.Notification#Notification(int,CharSequence,long)} constructor and the
-{@link android.app.Notification#setLatestEventInfo(Context,CharSequence,CharSequence,PendingIntent)}
-method. These define all the required settings for a Notification.
-The following snippet demonstrates a basic Notification setup:</p>
+<p>The starter-kit for a new notification includes the
+{@link android.app.Notification#Notification(int,CharSequence,long)} constructor and the
+{@link android.app.Notification#setLatestEventInfo(Context,CharSequence,CharSequence,PendingIntent)}
+method. These define all the required settings for a notification.
+The following snippet demonstrates a basic notification setup:</p>
<pre>
int icon = R.drawable.notification_icon; // icon from resources
CharSequence tickerText = "Hello"; // ticker-text
long when = System.currentTimeMillis(); // notification time
Context context = getApplicationContext(); // application Context
-CharSequence contentTitle = "My notification"; // expanded message title
-CharSequence contentText = "Hello World!"; // expanded message text
+CharSequence contentTitle = "My notification"; // message title
+CharSequence contentText = "Hello World!"; // message text
Intent notificationIntent = new Intent(this, MyClass.class);
PendingIntent contentIntent = PendingIntent.getActivity(this, 0, notificationIntent, 0);
@@ -187,32 +196,33 @@ notification.setLatestEventInfo(context, contentTitle, contentText, contentInten
<h3 id="Updating">Updating the notification</h3>
-<p>You can update the information in your status bar notification as events
-continue to occur in your application. For example, when a new SMS text message arrives
-before previous messages have been read, the Messaging application updates the existing
+<p>You can update the information in your status bar notification as events
+continue to occur in your application. For example, when a new SMS text message arrives
+before previous messages have been read, the Messaging application updates the existing
notification to display the total number of new messages received.
-This practice of updating an existing Notification is much better than adding new Notifications
-to the NotificationManager because it avoids clutter in the Notifications window.</p>
+This practice of updating an existing notification is much better than adding new
+notifications, because it avoids clutter in the notifications window.</p>
<p>Because each notification is uniquely identified
-by the NotificationManager with an integer ID, you can revise the notification by calling
-{@link android.app.Notification#setLatestEventInfo(Context,CharSequence,CharSequence,PendingIntent)
-setLatestEventInfo()} with new values, change some field values of the Notification, and then call
+by the {@link android.app.NotificationManager} with an integer ID, you can revise the notification
+by calling {@link
+android.app.Notification#setLatestEventInfo(Context,CharSequence,CharSequence,PendingIntent)
+setLatestEventInfo()} with new values, change some field values of the notification, and then call
{@link android.app.NotificationManager#notify(int,Notification) notify()} again.</p>
<p>You can revise each property with the object member fields
-(except for the Context and the expanded message title and text). You should always
-revise the text message when you update the notification by calling
+(except for the {@link android.content.Context} and the notification title and text). You
+should always revise the text message when you update the notification by calling
{@link android.app.Notification#setLatestEventInfo(Context,CharSequence,CharSequence,PendingIntent)
-setLatestEventInfo()} with new values for <var>contentTitle</var> and <var>contentText</var>.
-Then call {@link android.app.NotificationManager#notify(int,Notification) notify()} to update the
-notification. (Of course, if you've created a <a href="#CustomExpandedView">custom expanded
-view</a>, then updating these title and text values has no effect.)</p>
+setLatestEventInfo()} with new values for <var>contentTitle</var> and <var>contentText</var>.
+Then call {@link android.app.NotificationManager#notify(int,Notification) notify()} to update the
+notification. (Of course, if you've created a <a href="#CustomExpandedView">custom notification
+layout</a>, then updating these title and text values has no effect.)</p>
<h3 id="Sound">Adding a sound</h3>
-<p>You can alert the user with the default notification sound
+<p>You can alert the user with the default notification sound
(which is defined by the user) or with a sound specified by your application.</p>
<p>To use the user's default sound, add "DEFAULT_SOUND" to the <var>defaults</var> field:</p>
@@ -227,31 +237,35 @@ The following example uses a known audio file saved to the device SD card:</p>
notification.sound = Uri.parse("file:///sdcard/notification/ringer.mp3");
</pre>
-<p>In the next example, the audio file is chosen from the internal
+<p>In the next example, the audio file is chosen from the internal
{@link android.provider.MediaStore.Audio.Media MediaStore}'s {@link android.content.ContentProvider}:</p>
<pre>
notification.sound = Uri.withAppendedPath(Audio.Media.INTERNAL_CONTENT_URI, "6");
</pre>
-<p>In this case, the exact ID of the media file ("6") is known and appended to the content
+<p>In this case, the exact ID of the media file ("6") is known and appended to the content
{@link android.net.Uri}. If you don't know the exact ID, you must query all the
-media available in the MediaStore with a {@link android.content.ContentResolver}.
+media available in the {@link android.provider.MediaStore} with a {@link
+android.content.ContentResolver}.
See the <a href="{@docRoot}guide/topics/providers/content-providers.html">Content Providers</a>
documentation for more information on using a ContentResolver.</p>
<p>If you want the sound to continuously repeat until the user responds to the notification
-or the notification is cancelled, add "FLAG_INSISTENT" to the <var>flags</var> field.</p>
+or the notification is cancelled, add {@link android.app.Notification#FLAG_INSISTENT} to the
+<var>flags</var> field.</p>
-<p class="note"><strong>Note:</strong> If the <var>defaults</var> field includes
-"DEFAULT_SOUND", then the default sound overrides any sound defined by the <var>sound</var> field.</p>
+<p class="note"><strong>Note:</strong> If the <var>defaults</var> field includes
+{@link android.app.Notification#DEFAULT_SOUND}, then the default sound overrides any sound defined
+by the <var>sound</var> field.</p>
<h3 id="Vibration">Adding vibration</h3>
-<p>You can alert the user with the the default
+<p>You can alert the user with the the default
vibration pattern or with a vibration pattern defined by your application.</p>
-<p>To use the default pattern, add "DEFAULT_VIBRATE" to the <var>defaults</var> field:</p>
+<p>To use the default pattern, add {@link android.app.Notification#DEFAULT_VIBRATE} to the
+<var>defaults</var> field:</p>
<pre>
notification.defaults |= Notification.DEFAULT_VIBRATE;
</pre>
@@ -264,30 +278,32 @@ notification.vibrate = vibrate;
</pre>
<p>The long array defines the alternating pattern for the length of vibration off and on
-(in milliseconds). The first value is how long to wait (off) before beginning, the second
-value is the length of the first vibration, the third is the next length off, and so on.
+(in milliseconds). The first value is how long to wait (off) before beginning, the second
+value is the length of the first vibration, the third is the next length off, and so on.
The pattern can be as long as you like, but it can't be set to repeat.
</p>
-<p class="note"><strong>Note:</strong> If the <var>defaults</var> field includes
-"DEFAULT_VIBRATE", then the default vibration overrides any vibration defined by the
+<p class="note"><strong>Note:</strong> If the <var>defaults</var> field includes
+{@link android.app.Notification#DEFAULT_VIBRATE}, then the default vibration overrides any vibration
+defined by the
<var>vibrate</var> field.</p>
<h3 id="Lights">Adding flashing lights</h3>
-<p>To alert the user by flashing LED lights, you can implement the default
+<p>To alert the user by flashing LED lights, you can implement the default
light pattern (if available), or define your own color and pattern for the lights.</p>
-<p>To use the default light setting, add "DEFAULT_LIGHTS" to the <var>defaults</var> field:</p>
+<p>To use the default light setting, add {@link android.app.Notification#DEFAULT_LIGHTS} to the
+<var>defaults</var> field:</p>
<pre>
notification.defaults |= Notification.DEFAULT_LIGHTS;
</pre>
<p>To define your own color and pattern, define a value for the <var>ledARGB</var> field
-(for the color), the <var>ledOffMS</var> field (length of time, in milliseconds, to
-keep the light off), the <var>ledOnMS</var> (length of time, in milliseconds, to keep the light on),
-and also add "FLAG_SHOW_LIGHTS" to the <var>flags</var> field:</p>
+(for the color), the <var>ledOffMS</var> field (length of time, in milliseconds, to
+keep the light off), the <var>ledOnMS</var> (length of time, in milliseconds, to keep the light on),
+and also add {@link android.app.Notification#FLAG_SHOW_LIGHTS} to the <var>flags</var> field:</p>
<pre>
notification.ledARGB = 0xff00ff00;
notification.ledOnMS = 300;
@@ -295,114 +311,161 @@ notification.ledOffMS = 1000;
notification.flags |= Notification.FLAG_SHOW_LIGHTS;
</pre>
-<p>In this example, the green light repeatedly flashes on for 300 milliseconds and
-turns off for one second. Not every color in the spectrum is supported by the
-device LEDs, and not every device supports the same colors, so the hardware
+<p>In this example, the green light repeatedly flashes on for 300 milliseconds and
+turns off for one second. Not every color in the spectrum is supported by the
+device LEDs, and not every device supports the same colors, so the hardware
estimates to the best of its ability. Green is the most common notification color.</p>
<h3 id="More">More features</h3>
<p>You can add several more features to your notifications
-using Notification fields and flags. Some useful features include the following:</p>
+using {@link android.app.Notification} fields and flags. Some useful features include the
+following:</p>
<dl>
- <dt>"FLAG_AUTO_CANCEL" flag</dt>
+ <dt>{@link android.app.Notification#FLAG_AUTO_CANCEL} flag</dt>
<dd>Add this to the <var>flags</var> field to automatically cancel the notification
- after it is selected from the Notifications window.</dd>
- <dt>"FLAG_INSISTENT" flag</dt>
+ after it is selected from the notifications window.</dd>
+ <dt>{@link android.app.Notification#FLAG_INSISTENT} flag</dt>
<dd>Add this to the <var>flags</var> field to repeat the audio until the
user responds.</dd>
- <dt>"FLAG_ONGOING_EVENT" flag</dt>
+ <dt>{@link android.app.Notification#FLAG_ONGOING_EVENT} flag</dt>
<dd>Add this to the <var>flags</var> field to group the notification under the "Ongoing"
- title in the Notifications window. This indicates that the application is on-going &mdash;
- its processes is still running in the background, even when the application is not
+ title in the notifications window. This indicates that the application is on-going &mdash;
+ its processes are still running in the background, even when the application is not
visible (such as with music or a phone call).</dd>
- <dt>"FLAG_NO_CLEAR" flag</dt>
- <dd>Add this to the <var>flags</var> field to indicate that the notification should
- <em>not</em> be cleared by the "Clear notifications" button. This is particularly useful if
+ <dt>{@link android.app.Notification#FLAG_NO_CLEAR} flag</dt>
+ <dd>Add this to the <var>flags</var> field to indicate that the notification should
+ <em>not</em> be cleared by the "Clear notifications" button. This is particularly useful if
your notification is on-going.</dd>
- <dt><var>number</var> field</dt>
+ <dt>{@link android.app.Notification#number} field</dt>
<dd>This value indicates the current number of events represented by the notification.
The appropriate number is overlaid on top of the status bar icon.
If you intend to use this field, then you must start with "1" when the Notification is first
created. (If you change the value from zero to anything greater during an update, the number
is not shown.)</dd>
- <dt><var>iconLevel</var> field</dt>
- <dd>This value indicates the current level of a
+ <dt>{@link android.app.Notification#iconLevel} field</dt>
+ <dd>This value indicates the current level of a
{@link android.graphics.drawable.LevelListDrawable} that is used for the notification icon.
- You can animate the icon in the status bar by changing this value to correlate with the
+ You can animate the icon in the status bar by changing this value to correlate with the
drawable's defined in a LevelListDrawable. See the {@link android.graphics.drawable.LevelListDrawable}
reference for more information.</dd>
</dl>
-<p>See the {@link android.app.Notification} class reference for more information about additional
+<p>See the {@link android.app.Notification} class reference for more information about additional
features that you can customize for your application.</p>
-<h2 id="CustomExpandedView">Creating a Custom Expanded View</h2>
+<h2 id="CustomExpandedView">Creating a Custom Notification Layout</h2>
-<img src="{@docRoot}images/custom_message.png" alt="" style="float:right;" />
+<div class="figure" style="width:200px;margin-top:0">
+<img src="{@docRoot}images/custom_message.png" alt="" />
+<p class="img-caption"><strong>Figure 3.</strong> Notification with a custom layout.</p>
+</div>
-<p>By default, the expanded view used in the "Notifications" window includes a basic title and text
-message. These are defined by the <var>contentTitle</var> and <var>contentText</var>
+<p>By default, the notification that appears in the notifications window includes a title
+and the message text.
+These are defined by the <var>contentTitle</var> and <var>contentText</var>
parameters of the {@link android.app.Notification#setLatestEventInfo(Context,CharSequence,CharSequence,PendingIntent)
-setLatestEventInfo()} method. However, you can also define a custom layout for the expanded view using
-{@link android.widget.RemoteViews}. The screenshot to the right shows an example of a
-custom expanded view that uses an ImageView and TextView in a LinearLayout.</p>
+setLatestEventInfo()} method. However, you can also define a custom layout for the
+notification using
+{@link android.widget.RemoteViews}. Figure 3 shows an example of a
+custom notification layout. It looks similar to the default notification, but is
+actually created with a custom XML layout.</p>
-<p>To define your own layout for the expanded message,
-instantiate a {@link android.widget.RemoteViews} object and
-pass it to the <var>contentView</var> field of your Notification. Pass the
-{@link android.app.PendingIntent} to the <var>contentIntent</var> field.</p>
+<p>To define your own layout for the notification,
+instantiate a {@link android.widget.RemoteViews} object that inflates a custom layout file, then
+pass the {@link android.widget.RemoteViews} to the <var>contentView</var> field of your
+Notification.</p>
-<p>Creating a custom expanded view is best understood with an example:</p>
+<p>Creating a custom notification layout is best understood with an example:</p>
<ol>
- <li>Create the XML layout for the expanded view.
- For example, create a layout file called <code>custom_notification_layout.xml</code> and
- build it like so:
+ <li>Create the XML layout for the notification.
+ For example, the following layout is called <code>custom_notification.xml</code>:
<pre>
-&lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:orientation="horizontal"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent"
- android:padding="3dp"
- >
+&lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:id="@+id/layout"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent"
+ android:padding="10dp" >
&lt;ImageView android:id="@+id/image"
- android:layout_width="wrap_content"
- android:layout_height="fill_parent"
- android:layout_marginRight="10dp"
- />
+ android:layout_width="wrap_content"
+ android:layout_height="fill_parent"
+ android:layout_alignParentLeft="true"
+ android:layout_marginRight="10dp" />
+ &lt;TextView android:id="@+id/title"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_toRightOf="@id/image"
+ style="@style/NotificationTitle" />
&lt;TextView android:id="@+id/text"
- android:layout_width="wrap_content"
- android:layout_height="fill_parent"
- android:textColor="#000"
- />
-&lt;/LinearLayout>
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_toRightOf="@id/image"
+ android:layout_below="@id/title"
+ style="@style/NotificationText" />
+&lt;/RelativeLayout>
</pre>
- <p>This layout is used for the expanded view,
- but the content of the ImageView and TextView still needs to be defined by the application.
- RemoteViews offers some convenient methods that allow you to define this content...</p>
+ <p>Notice that the two {@link android.widget.TextView} elements include the {@code style}
+attribute. It's important that you use style resources for the text in your custom
+notifications, because the background color of the notification can vary across different
+devices and platform versions. Beginning with Android 2.3 (API level 9), the system defines a
+style for the text it uses for the default notification layouts. Thus, you should apply
+that style when running on Android 2.3 or higher to ensure that your text is visible against
+the background.</p>
+
+ <p>For example, to use the standard text colors on versions of Android lower than 2.3, you
+should use the following styles for {@code res/values/styles.xml}:</p>
+<pre>
+&lt;?xml version="1.0" encoding="utf-8"?>
+&lt;resources>
+ &lt;style name="NotificationText">
+ &lt;item name="android:textColor">?android:attr/textColorPrimary&lt;/item>
+ &lt;/style>
+ &lt;style name="NotificationTitle">
+ &lt;item name="android:textColor">?android:attr/textColorPrimary&lt;/item>
+ &lt;item name="android:textStyle">bold&lt;/item>
+ &lt;/style>
+ &lt;!-- If you want a slightly different color for some text,
+ consider using ?android:attr/textColorSecondary -->
+&lt;/resources>
+</pre>
+ <p>Then, to apply the system's default colors for notifications on Android
+2.3 and higher, use the following styles for {@code res/values-v9/styles.xml}:</p>
+<pre>
+&lt;?xml version="1.0" encoding="utf-8"?>
+&lt;resources>
+ &lt;style name="NotificationText" parent="android:TextAppearance.StatusBar.EventContent" />
+ &lt;style name="NotificationTitle" parent="android:TextAppearance.StatusBar.EventContent.Title" />
+&lt;/resources>
+</pre>
+ <p>Now, when running on Android 2.3 (API level 9) or higher, the text in your custom view will
+use the same colors that the system does for default notifications. This is important because later
+versions of Android actually change the background color of the notifications to be dark. Inheriting
+the system's styles ensures that your text will be light in such cases, but also if the background
+is some other unexpected color, your text will also change as appropriate.</p>
</li>
- <li>In the application code, use the RemoveViews
+ <li>Now, in the application code, use the RemoveViews
methods to define the image and text. Then pass the RemoteViews object to the <var>contentView</var>
field of the Notification, as shown in this example:
<pre>
RemoteViews contentView = new RemoteViews(getPackageName(), R.layout.custom_notification_layout);
contentView.setImageViewResource(R.id.image, R.drawable.notification_image);
-contentView.setTextViewText(R.id.text, "Hello, this message is in a custom expanded view");
+contentView.setTextViewText(R.id.title, "Custom notification");
+contentView.setTextViewText(R.id.text, "This is a custom layout");
notification.contentView = contentView;
</pre>
- <p>As shown here, pass the application's package name and the layout
+ <p>As shown here, pass the application's package name and the layout
resource ID to the RemoteViews constructor. Then, define the content for the ImageView and TextView,
using the {@link android.widget.RemoteViews#setImageViewResource(int, int) setImageViewResource()}
and {@link android.widget.RemoteViews#setTextViewText(int, CharSequence) setTextViewText()}.
In each case, pass the reference ID of the appropriate View object that you want to set, along with
- the value for that View. Finally, the RemoteViews object is passed to the Notification in the
+ the value for that View. Finally, the RemoteViews object is passed to the Notification in the
<var>contentView</var> field.</p>
</li>
@@ -416,23 +479,23 @@ PendingIntent contentIntent = PendingIntent.getActivity(this, 0, notificationInt
notification.contentIntent = contentIntent;
</pre>
</li>
-
+
<li>The notification can now be sent as usual:
<pre>mNotificationManager.notify(CUSTOM_VIEW_ID, notification);</pre>
</li>
</ol>
-<p>The RemoteViews class also includes methods that you can use to easily add a
-{@link android.widget.Chronometer} or {@link android.widget.ProgressBar}
-in your notification's expanded view. For more information about creating custom layouts with
-RemoteViews, refer to the {@link android.widget.RemoteViews} class reference.</p>
+<p>The {@link android.widget.RemoteViews} class also includes methods that you can use to easily add
+a {@link android.widget.Chronometer} or {@link android.widget.ProgressBar}
+in your notification's layout. For more information about creating custom layouts for your
+notification, refer to the {@link android.widget.RemoteViews} class reference.</p>
-<p class="warning"><strong>Note:</strong>
-When creating a custom expanded view, you must take special care to ensure that your
-custom layout functions properly in different device orientations and resolutions. While this
+<p class="caution"><strong>Caution:</strong>
+When creating a custom notification layout, you must take special care to ensure that your
+custom layout functions properly in different device orientations and resolutions. While this
advice applies to all View layouts created on Android, it is especially important in this case
-because your layout real estate is very restricted. So don't make your custom layout too
+because your layout real estate is very restricted. So don't make your custom layout too
complex and be sure to test it in various configurations.</p>
diff --git a/docs/html/guide/topics/usb/adk.jd b/docs/html/guide/topics/usb/adk.jd
index 463ec9c..120576b 100644
--- a/docs/html/guide/topics/usb/adk.jd
+++ b/docs/html/guide/topics/usb/adk.jd
@@ -77,6 +77,10 @@ page.title=Android Open Accessory Development Kit
DIY Drones</a></li>
<li><a href=
+ "http://mbed.org/order/">
+ mbed</a></li>
+
+ <li><a href=
"http://www.microchip.com/android">
Microchip</a></li>
@@ -130,6 +134,11 @@ page.title=Android Open Accessory Development Kit
Drones</a> provides an Arduino-compatible board geared towards RC (radio controlled) and UAV
(unmanned aerial vehicle) enthusiasts.</li>
+ <li><a href="http://mbed.org/order/">mbed</a> provides a microcontroller and a library
+ to develop accessories that support the Android accessory protocol. For more information, see
+ <a href="http://mbed.org/cookbook/mbed-with-Android-ADK">mbed with the Android ADK</a>.
+ </li>
+
<li><a href="http://www.microchip.com/android">Microchip</a> provides a PIC based USB
microcontroller board.</li>
diff --git a/docs/html/images/custom_message.png b/docs/html/images/custom_message.png
index ea7c716..00b7632 100755
--- a/docs/html/images/custom_message.png
+++ b/docs/html/images/custom_message.png
Binary files differ
diff --git a/docs/html/resources/articles/speech-input.jd b/docs/html/resources/articles/speech-input.jd
index 736087e..0867ff2 100644
--- a/docs/html/resources/articles/speech-input.jd
+++ b/docs/html/resources/articles/speech-input.jd
@@ -87,8 +87,8 @@ while the "web search" model is used when users want to search by voice. </p>
regularly. You can use the
{@link android.speech.RecognizerIntent#ACTION_GET_LANGUAGE_DETAILS}
broadcast intent to query for the list of supported languages.
-The web search model is available in all three languages, while free-form has
-primarily been optimized for English. As we work hard to support more models in
+The web search model is available for all languages, while the free-form model
+may not be optimized for all languages. As we work hard to support more models in
more languages, and to improve the accuracy of the speech recognition technology
we use in our products, Android developers who integrate speech capabilities
directly into their applications can reap the benefits as well. </p>
diff --git a/docs/html/resources/resources-data.js b/docs/html/resources/resources-data.js
index 720e143..6c5d882 100644
--- a/docs/html/resources/resources-data.js
+++ b/docs/html/resources/resources-data.js
@@ -31,7 +31,8 @@ var ANDROID_TAGS = {
},
misc: {
'external': 'External',
- 'new': 'New'
+ 'new': 'New',
+ 'updated': 'Updated'
}
};
@@ -322,6 +323,16 @@ var ANDROID_RESOURCES = [
}
},
{
+ tags: ['article', 'accountsync', 'data'],
+ path: 'articles/contacts.html',
+ title: {
+ en: 'Using the Contacts API'
+ },
+ description: {
+ en: 'Android provides a Contacts API for managing and integrating contacts from multiple accounts and data sources and allows apps to read various information about individual contacts.'
+ }
+ },
+ {
tags: ['article', 'ui', 'web'],
path: 'articles/using-webviews.html',
title: {
@@ -377,7 +388,7 @@ var ANDROID_RESOURCES = [
///////////////////
{
- tags: ['sample', 'new'],
+ tags: ['sample'],
path: 'samples/AccelerometerPlay/index.html',
title: {
en: 'Accelerometer Play'
@@ -387,7 +398,7 @@ var ANDROID_RESOURCES = [
}
},
{
- tags: ['sample', 'new', 'accessibility'],
+ tags: ['sample', 'accessibility'],
path: 'samples/AccessibilityService/index.html',
title: {
en: 'Accessibility Service'
@@ -407,7 +418,7 @@ var ANDROID_RESOURCES = [
}
},
{
- tags: ['sample', 'layout', 'ui', 'fragment', 'loader', 'new'],
+ tags: ['sample', 'layout', 'ui', 'fragment', 'loader'],
path: 'samples/Support4Demos/index.html',
title: {
en: 'API 4+ Support Demos'
@@ -417,7 +428,7 @@ var ANDROID_RESOURCES = [
}
},
{
- tags: ['sample', 'layout', 'ui', 'new'],
+ tags: ['sample', 'layout', 'ui'],
path: 'samples/Support13Demos/index.html',
title: {
en: 'API 13+ Support Demos'
@@ -487,13 +498,13 @@ var ANDROID_RESOURCES = [
}
},
{
- tags: ['sample', 'new', 'newfeature', 'ui'],
+ tags: ['sample', 'updated', 'newfeature', 'ui'],
path: 'samples/HoneycombGallery/index.html',
title: {
en: 'Honeycomb Gallery'
},
description: {
- en: 'An image gallery application using APIs that are new in Android 3.0 (a.k.a. Honeycomb).'
+ en: 'An image gallery application that demonstrates a variety of new APIs in Android 3.0 (Honeycomb). In addition to providing a tablet-optimized design, it also supports handsets running Android 4.0 (Ice Cream Sandwich) and beyond, so is a good example of how to reuse Fragments to support different screen sizes.'
}
},
{
@@ -547,7 +558,7 @@ var ANDROID_RESOURCES = [
}
},
{
- tags: ['sample', 'new', 'media' ],
+ tags: ['sample', 'media' ],
path: 'samples/RandomMusicPlayer/index.html',
title: {
en: 'Random Music Player'
@@ -557,7 +568,7 @@ var ANDROID_RESOURCES = [
}
},
{
- tags: ['sample', 'new', 'newfeature', 'performance', 'gamedev', 'gl'],
+ tags: ['sample', 'newfeature', 'performance', 'gamedev', 'gl'],
path: 'samples/RenderScript/index.html',
title: {
en: 'RenderScript'
@@ -637,7 +648,7 @@ var ANDROID_RESOURCES = [
}
},
{
- tags: ['sample', 'new', 'newfeature', 'widgets'],
+ tags: ['sample', 'newfeature', 'widgets'],
path: 'samples/StackWidget/index.html',
title: {
en: 'StackView Widget'
@@ -667,7 +678,7 @@ var ANDROID_RESOURCES = [
}
},
{
- tags: ['sample', 'new', 'newfeature'],
+ tags: ['sample', 'newfeature'],
path: 'samples/USB/index.html',
title: {
en: 'USB'
@@ -683,7 +694,7 @@ var ANDROID_RESOURCES = [
en: 'Voicemail Provider Demo'
},
description: {
- en: 'A sample application to demonstrate how to use voicemail content provider APIs.'
+ en: 'A sample application to demonstrate how to use voicemail content provider APIs in Android 4.0.'
}
},
{
@@ -707,7 +718,7 @@ var ANDROID_RESOURCES = [
}
},
{
- tags: ['sample', 'widgets', 'newfeature', 'new'],
+ tags: ['sample', 'widgets', 'newfeature'],
path: 'samples/WeatherListWidget/index.html',
title: {
en: 'Weather List Widget'
@@ -733,7 +744,7 @@ var ANDROID_RESOURCES = [
en: 'Text To Speech Engine'
},
description: {
- en: 'An example Text To Speech engine written using the android text to speech engine API.'
+ en: 'An example Text To Speech engine written using the Android text to speech engine API in Android 4.0.'
}
},
diff --git a/docs/html/sdk/android-3.2.jd b/docs/html/sdk/android-3.2.jd
index 5618eae..ea2b4ed 100644
--- a/docs/html/sdk/android-3.2.jd
+++ b/docs/html/sdk/android-3.2.jd
@@ -166,7 +166,7 @@ in which the application UI will need to be drawn, not including screen areas
reserved by the system.
</li>
-<li>In constrast, a screen's <em>width</em> and <em>height</em> represent the
+<li>In contrast, a screen's <em>width</em> and <em>height</em> represent the
current horizontal or vertical space available for application layout, measured
in "dp" units, not including screen areas reserved by the system. The width and
height of a screen change when the user switches orientation between landscape
@@ -313,7 +313,7 @@ is designed to run. If the current screen is larger than the value specified,
the system forces the application into screen compatibility mode, to ensure best
display on the current screen.</li>
-<li><code>android:smallestWidthLimitDp="<em>numDp"</em></code> &mdash; This
+<li><code>android:requiresSmallestWidthDp="<em>numDp"</em></code> &mdash; This
attribute lets you specify the minimum smallestWidth on which the application
can run. If the current screen is smaller than the value specified, the system
considers the application incompatible with the device, but does not prevent it
diff --git a/docs/html/sdk/index.jd b/docs/html/sdk/index.jd
index 5cf37c1..105c868 100644
--- a/docs/html/sdk/index.jd
+++ b/docs/html/sdk/index.jd
@@ -1,21 +1,21 @@
page.title=Android SDK
sdk.redirect=0
-sdk.win_installer=installer_r12-windows.exe
-sdk.win_installer_bytes=36531492
-sdk.win_installer_checksum=367f0ed4ecd70aefc290d1f7dcb578ab
+sdk.win_installer=installer_r13-windows.exe
+sdk.win_installer_bytes=36533357
+sdk.win_installer_checksum=cd3a76fe2b8ed62b2d03cf1851692e2d
-sdk.win_download=android-sdk_r12-windows.zip
-sdk.win_bytes=36486190
-sdk.win_checksum=8d6c104a34cd2577c5506c55d981aebf
+sdk.win_download=android-sdk_r13-windows.zip
+sdk.win_bytes=36487911
+sdk.win_checksum=de8a039891e5e65b7742f188f07b992d
-sdk.mac_download=android-sdk_r12-mac_x86.zip
-sdk.mac_bytes=30231118
-sdk.mac_checksum=341544e4572b4b1afab123ab817086e7
+sdk.mac_download=android-sdk_r13-mac_x86.zip
+sdk.mac_bytes=30233944
+sdk.mac_checksum=f4002a0344b48856c09dec796acecd4d
-sdk.linux_download=android-sdk_r12-linux_x86.tgz
-sdk.linux_bytes=30034243
-sdk.linux_checksum=f8485275a8dee3d1929936ed538ee99a
+sdk.linux_download=android-sdk_r13-linux_x86.tgz
+sdk.linux_bytes=30034328
+sdk.linux_checksum=d80d7530a46c665644ae76084a9a0dc4
@jd:body
diff --git a/docs/html/sdk/sdk_toc.cs b/docs/html/sdk/sdk_toc.cs
index a00ca12..8a57312 100644
--- a/docs/html/sdk/sdk_toc.cs
+++ b/docs/html/sdk/sdk_toc.cs
@@ -77,7 +77,7 @@ class="new">new!</span></li>
<ul>
<li class="toggle-list">
<div><a href="<?cs var:toroot ?>sdk/android-3.2.html">
- <span class="en">Android 3.2 Platform</span></a> <span class="new">new!</span></div>
+ <span class="en">Android 3.2 Platform</span></a></div>
<ul>
<!-- <li><a href="<?cs var:toroot ?>sdk/android-3.2-highlights.html">Platform Highlights</a></li> -->
<li><a href="<?cs var:toroot ?>sdk/api_diff/13/changes.html">API Differences Report &raquo;</a></li>
@@ -142,11 +142,11 @@ class="new">new!</span></li>
</li>
</ul>
<ul>
- <li><a href="<?cs var:toroot ?>sdk/tools-notes.html">SDK Tools, r12</a> <span
+ <li><a href="<?cs var:toroot ?>sdk/tools-notes.html">SDK Tools, r13</a> <span
class="new">new!</span></li>
<li><a href="<?cs var:toroot ?>sdk/win-usb.html">Google USB Driver, r4</a></li>
<li><a href="<?cs var:toroot ?>sdk/compatibility-library.html">Compatibility Package,
-r3</a> <span class="new">new!</span></li>
+r3</a></li>
</ul>
</li>
<li>
@@ -169,7 +169,7 @@ r3</a> <span class="new">new!</span></li>
<span style="display:none" class="ja"></span>
<span style="display:none" class="zh-CN"></span>
<span style="display:none" class="zh-TW"></span></a>
- <span class="new">new!</span></li>
+ </li>
</ul>
</li>
<li>
@@ -183,8 +183,7 @@ r3</a> <span class="new">new!</span></li>
<span style="display:none" class="zh-TW"></span>
</h2>
<ul>
- <li><a href="<?cs var:toroot ?>sdk/ndk/index.html">Android NDK, r6b</a>
- <span class="new">new!</span>
+ <li><a href="<?cs var:toroot ?>sdk/ndk/index.html">Android NDK, r6b</a>
</li>
<li><a href="<?cs var:toroot ?>sdk/ndk/overview.html">What is the NDK?</a></li>
</ul>
diff --git a/docs/html/sdk/tools-notes.jd b/docs/html/sdk/tools-notes.jd
index 8c4d037..2179cec 100644
--- a/docs/html/sdk/tools-notes.jd
+++ b/docs/html/sdk/tools-notes.jd
@@ -4,7 +4,7 @@ page.title=SDK Tools
<p>SDK Tools is a downloadable component for the Android SDK. It includes the
complete set of development and debugging tools for the Android SDK. </p>
-<p>If you are new to the Android SDK, the <a
+<p>If you are new to the Android SDK, the <a
href="{@docRoot}sdk/index.html">SDK starter package</a> installs the
latest revision of the SDK Tools in the <code>&lt;sdk&gt;/tools</code> directory.</p>
@@ -66,6 +66,35 @@ padding: .25em 1em;
<div class="toggleable opened">
<a href="#" onclick="return toggleDiv(this)">
<img src="{@docRoot}assets/images/triangle-opened.png" class="toggle-img" height="9px" width="9px" />
+SDK Tools, Revision 13</a> <em>(September 2011)</em>
+ <div class="toggleme">
+ <dl>
+<dt>Dependencies:</dt>
+<dd>
+<p>If you are developing in Eclipse with ADT, note that the SDK Tools r13 is designed for use with
+ADT 12.0.0 and later. If you haven't already, we highly recommend updating your <a
+href="{@docRoot}sdk/eclipse-adt.html">ADT Plugin</a> to 12.0.0.</p>
+
+<p>If you are developing outside Eclipse, you must have <a href="http://ant.apache.org/">Apache
+Ant</a> 1.8 or later.</p>
+
+<dt>General notes:</dt>
+<dd>
+ <ul>
+ <li>Fix compilation issue in Ant (<code>dex</code> step) when paths have spaces.</li>
+ <li>Fix issue in emulator installation when paths have spaces.</li>
+ <li>Fix issue when AVD paths have spaces.</li>
+ <li>Fix rendering issue when using emulator scaling (<a href="http://code.google.com/p/android/issues/detail?id=18299">see more</a>).</li>
+ </ul>
+</dd>
+</dl>
+</div>
+</div>
+
+
+<div class="toggleable closed">
+ <a href="#" onclick="return toggleDiv(this)">
+ <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-img" height="9px" width="9px" />
SDK Tools, Revision 12</a> <em>(July 2011)</em>
<div class="toggleme">
<dl>
@@ -396,7 +425,7 @@ install SDK Tools r4 in your SDK. </p></dd>
<dt>General notes:</dt>
<dd>
<ul>
-<li>Launcher script now forces GDK_NATIVE_WINDOW=true (linux only), to fix a
+<li>Launcher script now forces GDK_NATIVE_WINDOW=true (linux only), to fix a
compatibility issue between GTK and SWT.</li>
</ul>
</dd>
@@ -405,7 +434,7 @@ compatibility issue between GTK and SWT.</li>
<dd>
<ul>
<li>AVD Launch dialog now shows scale value.</li>
-<li>Fixes potential NPE in SDK Manager on AVD launch, for older AVD with no
+<li>Fixes potential NPE in SDK Manager on AVD launch, for older AVD with no
skin name specified.</li>
<li>Fixes XML validation issue in on older Java versions.</li>
<li>No longer forces the use of Java 1.5 on Mac OS X.</li>
@@ -470,7 +499,7 @@ display the trace.</li>
<dd>
<ul>
<li>Provides a new UI that lets you set options for controlling
-the emulator skin, screen size/density, and scale factor used when launching
+the emulator skin, screen size/density, and scale factor used when launching
an AVD.</li>
<li>Provides improved AVD creation UI, which lets you customize the hardware
properties of your AVDs.</li>
@@ -481,11 +510,11 @@ between SDK add-ons and platforms.</li>
<dt>Layoutopt, a new tool for optimizing layouts:</dt>
-<dd><p>The SDK Tools r3 package includes <code>layoutopt</code>, a new command-line
-tool that helps you optimize your layout hierarchies. When run against your
-layout files, the tool analyzes their hierarchies and notifies you of
-inefficiencies and other potential issues. The tool also provides simple
-solutions for the issues it finds. For usage, see <a
+<dd><p>The SDK Tools r3 package includes <code>layoutopt</code>, a new command-line
+tool that helps you optimize your layout hierarchies. When run against your
+layout files, the tool analyzes their hierarchies and notifies you of
+inefficiencies and other potential issues. The tool also provides simple
+solutions for the issues it finds. For usage, see <a
href="/guide/developing/tools/layoutopt.html">layoutopt</a>.</p>
</dd>
</dl>