summaryrefslogtreecommitdiffstats
path: root/docs/html/guide
diff options
context:
space:
mode:
Diffstat (limited to 'docs/html/guide')
-rw-r--r--docs/html/guide/components/intents-common.jd453
-rw-r--r--docs/html/guide/index.jd2
-rw-r--r--docs/html/guide/practices/screens_support.jd50
-rw-r--r--docs/html/guide/topics/admin/device-admin.jd7
-rw-r--r--docs/html/guide/topics/connectivity/usb/host.jd8
-rw-r--r--docs/html/guide/topics/manifest/activity-element.jd9
-rw-r--r--docs/html/guide/topics/manifest/application-element.jd6
-rw-r--r--docs/html/guide/topics/manifest/data-element.jd5
-rw-r--r--docs/html/guide/topics/manifest/uses-feature-element.jd4
-rw-r--r--docs/html/guide/topics/manifest/uses-sdk-element.jd9
-rw-r--r--docs/html/guide/topics/media/exoplayer.jd56
-rw-r--r--docs/html/guide/topics/resources/available-resources.jd1
-rw-r--r--docs/html/guide/topics/resources/providing-resources.jd18
-rw-r--r--docs/html/guide/topics/ui/layout/grid.jd2
-rw-r--r--docs/html/guide/topics/ui/layout/gridview.jd9
15 files changed, 117 insertions, 522 deletions
diff --git a/docs/html/guide/components/intents-common.jd b/docs/html/guide/components/intents-common.jd
index 05e3133..964f075 100644
--- a/docs/html/guide/components/intents-common.jd
+++ b/docs/html/guide/components/intents-common.jd
@@ -50,15 +50,6 @@ page.tags="IntentFilter"
<li><a href="#OpenFile">Open a specific type of file</a></li>
</ol>
</li>
- <li><a href="#Fitness">Fitness</a>
- <ol>
- <li><a href="#TrackRide">Start/Stop a bike ride</a></li>
- <li><a href="#TrackRun">Start/Stop a run</a></li>
- <li><a href="#TrackWorkout">Start/Stop a workout</a></li>
- <li><a href="#ShowHR">Show heart rate</a></li>
- <li><a href="#ShowStepCount">Show step count</a></li>
- </ol>
- </li>
<li><a href="#Local">Local Actions</a>
<ol>
<li><a href="#CallCar">Call a car</a></li>
@@ -1348,391 +1339,6 @@ Framework</a> guide.</p>
-
-
-
-
-
-<h2 id="Fitness">Fitness</h2>
-
-<h3 id="TrackRide">Start/Stop a bike ride</h3>
-
-<!-- Google Now box -->
-<div class="now-box">
- <div class="now-img-cont">
- <a href="#Now">
- <img src="{@docRoot}guide/components/images/voice-icon.png" class="now-img"
- width="30" height="30" alt=""/>
- </a>
- </div>
- <p class="now-title">Google Now</p>
- <ul>
- <li>"start cycling"</li>
- <li>"start my bike ride"</li>
- <li>"stop cycling"</li>
- </ul>
-</div>
-
-<p>To track a bike ride, use the
-<a href="{@docRoot}reference/com/google/android/gms/fitness/FitnessIntents.html#ACTION_TRACK">
-<code>ACTION_TRACK</code></a> action with the <code>"vnd.google.fitness.activity/biking"</code>
-MIME type and set the
-<a href="{@docRoot}reference/com/google/android/gms/fitness/FitnessIntents.html#EXTRA_STATUS">
-<code>EXTRA_STATUS</code></a> extra to
-<a href="{@docRoot}reference/com/google/android/gms/fitness/FitnessIntents.html#STATUS_ACTIVE">
-<code>STATUS_ACTIVE</code></a> when starting and to
-<a href="{@docRoot}reference/com/google/android/gms/fitness/FitnessIntents.html#STATUS_COMPLETED">
-<code>STATUS_COMPLETED</code></a> when stopping.</p>
-
-<dl>
- <dt><b>Action</b></dt>
- <dd><a href="{@docRoot}reference/com/google/android/gms/fitness/FitnessIntents.html#ACTION_TRACK">
- <code>ACTION_TRACK</code></a><dd>
-
- <dt><b>Data URI</b></dt>
- <dd>None</dd>
-
- <dt><b>MIME Type</b></dt>
- <dd><code>"vnd.google.fitness.activity/biking"</code></dd>
-
- <dt><b>Extras</b></dt>
- <dd>
- <dl>
- <dt><a href="{@docRoot}reference/com/google/android/gms/fitness/FitnessIntents.html#EXTRA_STATUS">
- <code>EXTRA_STATUS</code></a></dt>
- <dd>A string with the value <a href="{@docRoot}reference/com/google/android/gms/fitness/FitnessIntents.html#STATUS_ACTIVE">
- <code>STATUS_ACTIVE</code></a> when starting and
- <a href="{@docRoot}reference/com/google/android/gms/fitness/FitnessIntents.html#STATUS_COMPLETED">
- <code>STATUS_COMPLETED</code></a> when stopping.</dd>
- </dl>
- </dd>
-</dl>
-
-
-<p><b>Example intent:</b></p>
-<pre>
-public void startBikeRide() {
- Intent intent = new Intent(FitnessIntents.ACTION_TRACK)
- .setType("vnd.google.fitness.activity/biking")
- .putExtra(FitnessIntents.EXTRA_STATUS, FitnessIntents.STATUS_ACTIVE);
- if (intent.resolveActivity(getPackageManager()) != null) {
- startActivity(intent);
- }
-}
-</pre>
-
-
-<p><b>Example intent filter:</b></p>
-<pre>
-&lt;activity ...>
- &lt;intent-filter>
- &lt;action android:name="vnd.google.fitness.TRACK" />
- &lt;data android:mimeType="vnd.google.fitness.activity/biking" />
- &lt;category android:name="android.intent.category.DEFAULT" />
- &lt;/intent-filter>
-&lt;/activity>
-</pre>
-
-
-
-
-
-<h3 id="TrackRun">Start/Stop a run</h3>
-
-<!-- Google Now box -->
-<div class="now-box">
- <div class="now-img-cont">
- <a href="#Now">
- <img src="{@docRoot}guide/components/images/voice-icon.png" class="now-img"
- width="30" height="30" alt=""/>
- </a>
- </div>
- <p class="now-title">Google Now</p>
- <ul>
- <li>"track my run"</li>
- <li>"start running"</li>
- <li>"stop running"</li>
- </ul>
-</div>
-
-<p>To track a run, use the
-<a href="{@docRoot}reference/com/google/android/gms/fitness/FitnessIntents.html#ACTION_TRACK">
-<code>ACTION_TRACK</code></a> action with the <code>"vnd.google.fitness.activity/running"</code>
-MIME type and set the
-<a href="{@docRoot}reference/com/google/android/gms/fitness/FitnessIntents.html#EXTRA_STATUS">
-<code>EXTRA_STATUS</code></a> extra to
-<a href="{@docRoot}reference/com/google/android/gms/fitness/FitnessIntents.html#STATUS_ACTIVE">
-<code>STATUS_ACTIVE</code></a> when starting and to
-<a href="{@docRoot}reference/com/google/android/gms/fitness/FitnessIntents.html#STATUS_COMPLETED">
-<code>STATUS_COMPLETED</code></a> when stopping.</p>
-
-<dl>
- <dt><b>Action</b></dt>
- <dd><a href="{@docRoot}reference/com/google/android/gms/fitness/FitnessIntents.html#ACTION_TRACK">
- <code>ACTION_TRACK</code></a><dd>
-
- <dt><b>Data URI</b></dt>
- <dd>None</dd>
-
- <dt><b>MIME Type</b></dt>
- <dd><code>"vnd.google.fitness.activity/running"</code></dd>
-
- <dt><b>Extras</b></dt>
- <dd>
- <dl>
- <dt><a href="{@docRoot}reference/com/google/android/gms/fitness/FitnessIntents.html#EXTRA_STATUS">
- <code>EXTRA_STATUS</code></a></dt>
- <dd>A string with the value <a href="{@docRoot}reference/com/google/android/gms/fitness/FitnessIntents.html#STATUS_ACTIVE">
- <code>STATUS_ACTIVE</code></a> when starting and
- <a href="{@docRoot}reference/com/google/android/gms/fitness/FitnessIntents.html#STATUS_COMPLETED">
- <code>STATUS_COMPLETED</code></a> when stopping.</dd>
- </dl>
- </dd>
-</dl>
-
-
-<p><b>Example intent:</b></p>
-<pre>
-public void startRun() {
- Intent intent = new Intent(FitnessIntents.ACTION_TRACK)
- .setType("vnd.google.fitness.activity/running")
- .putExtra(FitnessIntents.EXTRA_STATUS, FitnessIntents.STATUS_ACTIVE);
- if (intent.resolveActivity(getPackageManager()) != null) {
- startActivity(intent);
- }
-}
-</pre>
-
-
-<p><b>Example intent filter:</b></p>
-<pre>
-&lt;activity ...>
- &lt;intent-filter>
- &lt;action android:name="vnd.google.fitness.TRACK" />
- &lt;data android:mimeType="vnd.google.fitness.activity/running" />
- &lt;category android:name="android.intent.category.DEFAULT" />
- &lt;/intent-filter>
-&lt;/activity>
-</pre>
-
-
-
-
-<h3 id="TrackWorkout">Start/Stop a workout</h3>
-
-<!-- Google Now box -->
-<div class="now-box">
- <div class="now-img-cont">
- <a href="#Now">
- <img src="{@docRoot}guide/components/images/voice-icon.png" class="now-img"
- width="30" height="30" alt=""/>
- </a>
- </div>
- <p class="now-title">Google Now</p>
- <ul>
- <li>"start a workout"</li>
- <li>"track my workout"</li>
- <li>"stop workout"</li>
- </ul>
-</div>
-
-<p>To track a workout, use the
-<a href="{@docRoot}reference/com/google/android/gms/fitness/FitnessIntents.html#ACTION_TRACK">
-<code>ACTION_TRACK</code></a> action with the <code>"vnd.google.fitness.activity/other"</code>
-MIME type and set the
-<a href="{@docRoot}reference/com/google/android/gms/fitness/FitnessIntents.html#EXTRA_STATUS">
-<code>EXTRA_STATUS</code></a> extra to
-<a href="{@docRoot}reference/com/google/android/gms/fitness/FitnessIntents.html#STATUS_ACTIVE">
-<code>STATUS_ACTIVE</code></a> when starting and to
-<a href="{@docRoot}reference/com/google/android/gms/fitness/FitnessIntents.html#STATUS_COMPLETED">
-<code>STATUS_COMPLETED</code></a> when stopping.</p>
-
-<dl>
- <dt><b>Action</b></dt>
- <dd><a href="{@docRoot}reference/com/google/android/gms/fitness/FitnessIntents.html#ACTION_TRACK">
- <code>ACTION_TRACK</code></a><dd>
-
- <dt><b>Data URI</b></dt>
- <dd>None</dd>
-
- <dt><b>MIME Type</b></dt>
- <dd><code>"vnd.google.fitness.activity/other"</code></dd>
-
- <dt><b>Extras</b></dt>
- <dd>
- <dl>
- <dt><a href="{@docRoot}reference/com/google/android/gms/fitness/FitnessIntents.html#EXTRA_STATUS">
- <code>EXTRA_STATUS</code></a></dt>
- <dd>A string with the value <a href="{@docRoot}reference/com/google/android/gms/fitness/FitnessIntents.html#STATUS_ACTIVE">
- <code>STATUS_ACTIVE</code></a> when starting and
- <a href="{@docRoot}reference/com/google/android/gms/fitness/FitnessIntents.html#STATUS_COMPLETED">
- <code>STATUS_COMPLETED</code></a> when stopping.</dd>
- </dl>
- </dd>
-</dl>
-
-
-<p><b>Example intent:</b></p>
-<pre>
-public void startWorkout() {
- Intent intent = new Intent(FitnessIntents.ACTION_TRACK)
- .setType("vnd.google.fitness.activity/other")
- .putExtra(FitnessIntents.EXTRA_STATUS, FitnessIntents.STATUS_ACTIVE);
- if (intent.resolveActivity(getPackageManager()) != null) {
- startActivity(intent);
- }
-}
-</pre>
-
-
-<p><b>Example intent filter:</b></p>
-<pre>
-&lt;activity ...>
- &lt;intent-filter>
- &lt;action android:name="vnd.google.fitness.TRACK" />
- &lt;data android:mimeType="vnd.google.fitness.activity/other" />
- &lt;category android:name="android.intent.category.DEFAULT" />
- &lt;/intent-filter>
-&lt;/activity>
-</pre>
-
-
-
-
-<h3 id="ShowHeartRate">Show heart rate</h3>
-
-<!-- Google Now box -->
-<div class="now-box">
- <div class="now-img-cont">
- <a href="#Now">
- <img src="{@docRoot}guide/components/images/voice-icon.png" class="now-img"
- width="30" height="30" alt=""/>
- </a>
- </div>
- <p class="now-title">Google Now</p>
- <ul>
- <li>"what's my heart rate?"</li>
- <li>"what's my bpm?"</li>
- </ul>
-</div>
-
-<p>To show the user's heart rate, use the
-<a href="{@docRoot}reference/com/google/android/gms/fitness/FitnessIntents.html#ACTION_VIEW">
-<code>ACTION_VIEW</code></a> action with the
-<code>"vnd.google.fitness.data_type/com.google.heart_rate.bpm"</code> MIME type.</p>
-
-<dl>
- <dt><b>Action</b></dt>
- <dd><a href="{@docRoot}reference/com/google/android/gms/fitness/FitnessIntents.html#ACTION_VIEW">
- <code>ACTION_VIEW</code></a><dd>
-
- <dt><b>Data URI</b></dt>
- <dd>None</dd>
-
- <dt><b>MIME Type</b></dt>
- <dd><code>"vnd.google.fitness.data_type/com.google.heart_rate.bpm"</code></dd>
-
- <dt><b>Extras</b></dt>
- <dd>None</dd>
-</dl>
-
-
-<p><b>Example intent:</b></p>
-<pre>
-public void showHeartRate() {
- Intent intent = new Intent(FitnessIntents.ACTION_VIEW)
- .setType("vnd.google.fitness.data_type/com.google.heart_rate.bpm");
- if (intent.resolveActivity(getPackageManager()) != null) {
- startActivity(intent);
- }
-}
-</pre>
-
-
-<p><b>Example intent filter:</b></p>
-<pre>
-&lt;activity ...>
- &lt;intent-filter>
- &lt;action android:name="vnd.google.fitness.VIEW" />
- &lt;data android:mimeType="vnd.google.fitness.data_type/com.google.heart_rate.bpm" />
- &lt;category android:name="android.intent.category.DEFAULT" />
- &lt;/intent-filter>
-&lt;/activity>
-</pre>
-
-
-
-
-
-<h3 id="ShowStepCount">Show step count</h3>
-
-<!-- Google Now box -->
-<div class="now-box">
- <div class="now-img-cont">
- <a href="#Now">
- <img src="{@docRoot}guide/components/images/voice-icon.png" class="now-img"
- width="30" height="30" alt=""/>
- </a>
- </div>
- <p class="now-title">Google Now</p>
- <ul>
- <li>"how many steps have I taken?"</li>
- <li>"what's my step count?"</li>
- </ul>
-</div>
-
-<p>To show the user's step count, use the
-<a href="{@docRoot}reference/com/google/android/gms/fitness/FitnessIntents.html#ACTION_VIEW">
-<code>ACTION_VIEW</code></a> action with the
-<code>"vnd.google.fitness.data_type<br/>/com.google.step_count<br/>.cumulative"</code> MIME
-type.</p>
-
-<dl>
- <dt><b>Action</b></dt>
- <dd><a href="{@docRoot}reference/com/google/android/gms/fitness/FitnessIntents.html#ACTION_VIEW">
- <code>ACTION_VIEW</code></a><dd>
-
- <dt><b>Data URI</b></dt>
- <dd>None</dd>
-
- <dt><b>MIME Type</b></dt>
- <dd><code>"vnd.google.fitness.data_type/com.google.step_count.cumulative"</code></dd>
-
- <dt><b>Extras</b></dt>
- <dd>None</dd>
-</dl>
-
-
-<p><b>Example intent:</b></p>
-<pre>
-public void showStepCount() {
- Intent intent = new Intent(FitnessIntents.ACTION_VIEW)
- .setType("vnd.google.fitness.data_type/com.google.step_count.cumulative");
- if (intent.resolveActivity(getPackageManager()) != null) {
- startActivity(intent);
- }
-}
-</pre>
-
-
-<p><b>Example intent filter:</b></p>
-<pre>
-&lt;activity ...>
- &lt;intent-filter>
- &lt;action android:name="vnd.google.fitness.VIEW" />
- &lt;data android:mimeType="vnd.google.fitness.data_type/com.google.step_count.cumulative" />
- &lt;category android:name="android.intent.category.DEFAULT" />
- &lt;/intent-filter>
-&lt;/activity>
-</pre>
-
-
-
-
-
-
-
-
<h2 id="Local">Local Actions</h2>
<h3 id="CallCar">Call a car</h3>
@@ -2695,65 +2301,6 @@ about declaring each intent filter, click on the action description.</p>
<td>{@link android.content.Intent#ACTION_CALL Intent.ACTION_CALL}</td>
</tr>
<tr>
- <td rowspan="5" style="vertical-align:middle">Fitness</td>
- <td>
- <p><a href="#TrackRide">Start/stop a bike ride</a></p>
- <ul class="now-list">
- <li>"start cycling"</li>
- <li>"start my bike ride"</li>
- <li>"stop cycling"</li>
- </ul>
- </td>
- <td><a href="{@docRoot}reference/com/google/android/gms/fitness/FitnessIntents.html#ACTION_TRACK">
- <code>FitnessIntents.ACTION_TRACK</code></a></td>
-</tr>
-<tr>
- <td>
- <p><a href="#TrackRun">Start/stop a run</a></p>
- <ul class="now-list">
- <li>"track my run"</li>
- <li>"start running"</li>
- <li>"stop running"</li>
- </ul>
- </td>
- <td><a href="{@docRoot}reference/com/google/android/gms/fitness/FitnessIntents.html#ACTION_TRACK">
- <code>FitnessIntents.ACTION_TRACK</code></a></td>
-</tr>
-<tr>
- <td>
- <p><a href="#TrackWorkout">Start/stop a workout</a></p>
- <ul class="now-list">
- <li>"start a workout"</li>
- <li>"track my workout"</li>
- <li>"stop workout"</li>
- </ul>
- </td>
- <td><a href="{@docRoot}reference/com/google/android/gms/fitness/FitnessIntents.html#ACTION_TRACK">
- <code>FitnessIntents.ACTION_TRACK</code></a></code></td>
-</tr>
-<tr>
- <td>
- <p><a href="#ShowHeartRate">Show heart rate</a></p>
- <ul class="now-list">
- <li>"what's my heart rate"</li>
- <li>"what's my bpm"</li>
- </ul>
- </td>
- <td><a href="{@docRoot}reference/com/google/android/gms/fitness/FitnessIntents.html#ACTION_VIEW">
- <code>FitnessIntents.ACTION_VIEW</code></a></code></td>
-</tr>
-<tr>
- <td>
- <p><a href="#ShowStepCount">Show step count</a></p>
- <ul class="now-list">
- <li>"how many steps have I taken"</li>
- <li>"what's my step count"</li>
- </ul>
- </td>
- <td><a href="{@docRoot}reference/com/google/android/gms/fitness/FitnessIntents.html#ACTION_VIEW">
- <code>FitnessIntents.ACTION_VIEW</code></a></td>
-</tr>
-<tr>
<td style="vertical-align:middle">Local</td>
<td>
<p><a href="#CallCar">Book a car</a></p>
diff --git a/docs/html/guide/index.jd b/docs/html/guide/index.jd
index d78a1b1..cb4f65c 100644
--- a/docs/html/guide/index.jd
+++ b/docs/html/guide/index.jd
@@ -30,7 +30,7 @@ screen for a user interface, and a <em>service</em> independently performs
work in the background.</p>
<p>From one component you can start another component using an <em>intent</em>. You can even start
-a component in a different app, such an activity in a maps app to show an address. This model
+a component in a different app, such as an activity in a maps app to show an address. This model
provides multiple entry points for a single app and allows any app to behave as a user's "default"
for an action that other apps may invoke.</p>
diff --git a/docs/html/guide/practices/screens_support.jd b/docs/html/guide/practices/screens_support.jd
index 7ebda53..b6f1c49 100644
--- a/docs/html/guide/practices/screens_support.jd
+++ b/docs/html/guide/practices/screens_support.jd
@@ -1,5 +1,5 @@
page.title=Supporting Multiple Screens
-page.metaDescription=Nanaging UIs for the best display on multiple screen sizes.
+page.metaDescription=Managing UIs for the best display on multiple screen sizes.
meta.tags="multiple screens"
@jd:body
@@ -348,13 +348,13 @@ can use for density-specific resources are <code>ldpi</code> (low), <code>mdpi</
<code>hdpi</code> (high), <code>xhdpi</code> extra-high), <code>xxhdpi</code>
(extra-extra-high), and <code>xxxhdpi</code> (extra-extra-extra-high). For example, bitmaps
for high-density screens should go in {@code drawable-hdpi/}.</p>
- <p class="note" id="xxxhdpi-note"><strong>Note:</strong> the <code>drawable-xxxhdpi</code>
+ <p class="note" id="xxxhdpi-note"><strong>Note:</strong> The <code>mipmap-xxxhdpi</code>
qualifier is necessary only to provide a launcher icon that can appear larger than usual on an
xxhdpi device. You do not need to provide xxxhdpi assets for all your app's images.</p>
<p>Some devices scale-up the launcher icon by as much as 25%. For example, if your highest
density launcher icon image is already extra-extra-high-density, the scaling process will make it
appear less crisp. So you should provide a higher density launcher icon in the
-<code>drawable-xxxhdpi</code> directory, which the system uses instead of scaling up a smaller
+<code>mipmap-xxxhdpi</code> directory, which the system uses instead of scaling up a smaller
version of the icon.</p>
<p>See <a href="{@docRoot}design/style/iconography.html#xxxhdpi-launcher">Provide an
xxx-high-density launcher icon</a> for more information. You should not use the
@@ -362,6 +362,16 @@ xxx-high-density launcher icon</a> for more information. You should not use the
</li>
</ul>
+<p class="note"><strong>Note:</strong> Place all your launcher icons in the
+<code>res/mipmap-[density]/</code> folders, rather than the <code>res/drawable-[density]/</code>
+folders. The Android system retains the resources in these density-specific folders, such as
+mipmap-xxxhdpi, regardless of the screen resolution of the device where your app is installed. This
+behavior allows launcher apps to pick the best resolution icon for your app to display on the home
+screen. For more information about using the mipmap folders, see
+<a href="{@docRoot}tools/projects/index.html#mipmap">Managing Projects Overview</a>.
+</p>
+
+
<p>The size and density configuration qualifiers correspond to the generalized sizes and densities
described in <a href="#range">Range of screens supported</a>, above.</p>
@@ -538,9 +548,9 @@ screen sizes (instead of using the size qualifiers in table 1).</p></p>
sizes and densities, see <a href="#range">Range of Screens Supported</a>, earlier in this
document.</p>
-<p>For example, the following is a list of resource directories in an application that
-provides different layout designs for different screen sizes and different bitmap drawables
-for medium, high, and extra-high-density screens.</p>
+<p>For example, the following application resource directories provide different layout designs
+for different screen sizes and different drawables. Use the <code>mipmap/</code> folders for
+launcher icons.</p>
<pre class="classic">
res/layout/my_layout.xml // layout for normal screen size ("default")
@@ -548,10 +558,16 @@ res/layout-large/my_layout.xml // layout for large screen size
res/layout-xlarge/my_layout.xml // layout for extra-large screen size
res/layout-xlarge-land/my_layout.xml // layout for extra-large in landscape orientation
-res/drawable-mdpi/my_icon.png // bitmap for medium-density
-res/drawable-hdpi/my_icon.png // bitmap for high-density
-res/drawable-xhdpi/my_icon.png // bitmap for extra-high-density
-res/drawable-xxhdpi/my_icon.png // bitmap for extra-extra-high-density
+res/drawable-mdpi/graphic.png // bitmap for medium-density
+res/drawable-hdpi/graphic.png // bitmap for high-density
+res/drawable-xhdpi/graphic.png // bitmap for extra-high-density
+res/drawable-xxhdpi/graphic.png // bitmap for extra-extra-high-density
+
+res/mipmap-mdpi/my_icon.png // launcher icon for medium-density
+res/mipmap-hdpi/my_icon.png // launcher icon for high-density
+res/mipmap-xhdpi/my_icon.png // launcher icon for extra-high-density
+res/mipmap-xxhdpi/my_icon.png // launcher icon for extra-extra-high-density
+res/mipmap-xxxhdpi/my_icon.png // launcher icon for extra-extra-extra-high-density
</pre>
<p>For more information about how to use alternative resources and a complete list of
@@ -560,7 +576,7 @@ configuration qualifiers (not just for screen configurations), see
Providing Alternative Resources</a>.</p>
<p>Be aware that, when the Android system picks which resources to use at runtime, it uses
-certain logic to determing the "best matching" resources. That is, the qualifiers you use don't
+certain logic to determine the "best matching" resources. That is, the qualifiers you use don't
have to exactly match the current screen configuration in all cases in order for the system to
use them. Specifically, when selecting resources based on the size qualifiers, the system will
use resources designed for a screen smaller than the current screen if there are no resources
@@ -703,10 +719,10 @@ such, you can now specify that these layout resources should be used only when t
smallest width your layout supports once it's complete.</p>
<p class="note"><strong>Note:</strong> Remember that all the figures used with these new size APIs
-are density-indpendent pixel (dp) values and your layout dimensions should also always be defined
+are density-independent pixel (dp) values and your layout dimensions should also always be defined
using dp units, because what you care about is the amount of screen space available after the system
accounts for screen density (as opposed to using raw pixel resolution). For more information about
-density-indpendent pixels, read <a href="#terms">Terms and concepts</a>, earlier in this
+density-independent pixels, read <a href="#terms">Terms and concepts</a>, earlier in this
document.</p>
@@ -728,7 +744,7 @@ Also beware that the <a href="{@docRoot}guide/topics/ui/actionbar.html">Action B
a part of your application's window space, although your layout does not declare it, so it reduces
the space available for your layout and you must account for it in your design.</p>
-<p class="table-caption"><strong>Table 2.</strong> New configuration qualifers for screen size
+<p class="table-caption"><strong>Table 2.</strong> New configuration qualifiers for screen size
(introduced in Android 3.2).</p>
<table>
<tr><th>Screen configuration</th><th>Qualifier values</th><th>Description</th></tr>
@@ -745,7 +761,7 @@ height and width (you may also think of it as the "smallest possible width" for
use this qualifier to ensure that, regardless of the screen's current orientation, your
application's has at least {@code &lt;N&gt;} dps of width available for its UI.</p>
<p>For example, if your layout requires that its smallest dimension of screen area be at
-least 600 dp at all times, then you can use this qualifer to create the layout resources, {@code
+least 600 dp at all times, then you can use this qualifier to create the layout resources, {@code
res/layout-sw600dp/}. The system will use these resources only when the smallest dimension of
available screen is at least 600dp, regardless of whether the 600dp side is the user-perceived
height or width. The smallestWidth is a fixed screen size characteristic of the device; <strong>the
@@ -851,7 +867,7 @@ res/layout-sw600dp/main_activity.xml # For 7” tablets (600dp wide and bigger
res/layout-sw720dp/main_activity.xml # For 10” tablets (720dp wide and bigger)
</pre>
-<p>Notice that the previous two sets of example resources use the "smallest width" qualifer, {@code
+<p>Notice that the previous two sets of example resources use the "smallest width" qualifier, {@code
sw&lt;N&gt;dp}, which specifies the smallest of the screen's two sides, regardless of the
device's current orientation. Thus, using {@code sw&lt;N&gt;dp} is a simple way to specify the
overall screen size available for your layout by ignoring the screen's orientation.</p>
@@ -1392,4 +1408,4 @@ between 0.1 and 3 that represents the desired scaling factor.</p>
<p>For more information about creating AVDs from the command line, see <a
href="{@docRoot}tools/devices/managing-avds-cmdline.html">Managing AVDs from the
-Command Line</a>.</p> \ No newline at end of file
+Command Line</a>.</p>
diff --git a/docs/html/guide/topics/admin/device-admin.jd b/docs/html/guide/topics/admin/device-admin.jd
index bed4b4d..45bd76a 100644
--- a/docs/html/guide/topics/admin/device-admin.jd
+++ b/docs/html/guide/topics/admin/device-admin.jd
@@ -48,6 +48,11 @@ solutions for Android-powered devices. It discusses the various features
provided by the Device Administration API to provide stronger security for
employee devices that are powered by Android.</p>
+<p class="note"><strong>Note</strong> For information on building a Work Policy
+Controller for Android for Work deployments, see <a
+href="{@docRoot}training/enterprise/work-policy-ctrl.html">Building a Work
+Policy Controller</a>.</p>
+
<h2 id="overview">Device Administration API Overview</h2>
@@ -712,4 +717,4 @@ mDPM.setStorageEncryption(mDeviceAdminSample, true);
</pre>
<p>
See the Device Administration API sample for a complete example of how to enable storage encryption.
-</p> \ No newline at end of file
+</p>
diff --git a/docs/html/guide/topics/connectivity/usb/host.jd b/docs/html/guide/topics/connectivity/usb/host.jd
index 355dd2d..f957b60 100644
--- a/docs/html/guide/topics/connectivity/usb/host.jd
+++ b/docs/html/guide/topics/connectivity/usb/host.jd
@@ -31,7 +31,7 @@ page.title=USB Host
<li><a href="{@docRoot}resources/samples/USB/AdbTest/index.html">AdbTest</a></li>
<li><a href=
- "{@docRoot}resources/samples/USB/MissileLauncher/index.html">MissleLauncher</a></li>
+ "{@docRoot}resources/samples/USB/MissileLauncher/index.html">MissileLauncher</a></li>
</ol>
</div>
</div>
@@ -283,7 +283,7 @@ while(deviceIterator.hasNext()){
<h3 id="permission-d">Obtaining permission to communicate with a device</h3>
- <p>Before communicating with the USB device, your applicaton must have permission from your
+ <p>Before communicating with the USB device, your application must have permission from your
users.</p>
<p class="note"><strong>Note:</strong> If your application <a href="#using-intents">uses an
@@ -388,7 +388,7 @@ mUsbManager.requestPermission(device, mPermissionIntent);
should have more logic to correctly find the correct interface and endpoints to communicate on
and also should do any transferring of data in a different thread than the main UI thread:</p>
<pre>
-private Byte[] bytes
+private Byte[] bytes;
private static int TIMEOUT = 0;
private boolean forceClaim = true;
@@ -409,7 +409,7 @@ connection.bulkTransfer(endpoint, bytes, bytes.length, TIMEOUT); //do in another
<p>For more information, see the <a href=
"{@docRoot}resources/samples/USB/AdbTest/index.html">AdbTest sample</a>, which shows how to do
asynchronous bulk transfers, and the <a href=
- "{@docRoot}resources/samples/USB/MissileLauncher/index.html">MissleLauncher sample</a>, which
+ "{@docRoot}resources/samples/USB/MissileLauncher/index.html">MissileLauncher sample</a>, which
shows how to listen on an interrupt endpoint asynchronously.</p>
<h3 id="terminating-d">Terminating communication with a device</h3>
diff --git a/docs/html/guide/topics/manifest/activity-element.jd b/docs/html/guide/topics/manifest/activity-element.jd
index c1256f9..99e64d9 100644
--- a/docs/html/guide/topics/manifest/activity-element.jd
+++ b/docs/html/guide/topics/manifest/activity-element.jd
@@ -13,10 +13,11 @@ parent.link=manifest-intro.html
android:<a href="#clear">clearTaskOnLaunch</a>=["true" | "false"]
android:<a href="#config">configChanges</a>=["mcc", "mnc", "locale",
"touchscreen", "keyboard", "keyboardHidden",
- "navigation", "screenLayout", "fontScale", "uiMode",
- "orientation", "screenSize", "smallestScreenSize"]
- android:<a href="#dlmode">documentLaunchMode</a>=["intoExisting", "always",
- "none", "never"]
+ "navigation", "screenLayout", "fontScale",
+ "uiMode", "orientation", "screenSize",
+ "smallestScreenSize"]
+ android:<a href="#dlmode">documentLaunchMode</a>=["intoExisting" | "always" |
+ "none" | "never"]
android:<a href="#enabled">enabled</a>=["true" | "false"]
android:<a href="#exclude">excludeFromRecents</a>=["true" | "false"]
android:<a href="#exported">exported</a>=["true" | "false"]
diff --git a/docs/html/guide/topics/manifest/application-element.jd b/docs/html/guide/topics/manifest/application-element.jd
index 8a0e837..b5af9c3 100644
--- a/docs/html/guide/topics/manifest/application-element.jd
+++ b/docs/html/guide/topics/manifest/application-element.jd
@@ -449,9 +449,13 @@ href="{@docRoot}guide/topics/ui/actionbar.html">Action Bar</a> developer guide.<
<dt><a name="vmSafeMode"></a>{@code android:vmSafeMode}</dt>
<dd>Indicates whether the app would like the virtual machine (VM) to operate
in safe mode. The default value is {@code "false"}.
-</dd>
+<p> This attribute was added in API level 8 where a value of "true"
+disabled the Dalvik just-in-time (JIT) compiler. </p>
+<p> This attribute was adapted in API level 22 where a value of "true"
+disabled the ART ahead-of-time (AOT) compiler. </p>
+</dd>
</dl></dd>
diff --git a/docs/html/guide/topics/manifest/data-element.jd b/docs/html/guide/topics/manifest/data-element.jd
index ecba508..77f16dd 100644
--- a/docs/html/guide/topics/manifest/data-element.jd
+++ b/docs/html/guide/topics/manifest/data-element.jd
@@ -24,7 +24,7 @@ just a URI, or both a data type and a URI. A URI is specified by separate
attributes for each of its parts:
<p style="margin-left: 2em">
-{@code &lt;scheme>://&lt;host>:&lt;port>/[&lt;path>|&lt;pathPrefix>|&lt;pathPattern>]}</p>
+{@code &lt;scheme>://&lt;host>:&lt;port>[&lt;path>|&lt;pathPrefix>|&lt;pathPattern>]}</p>
<p>
These attributes that specify the URL format are optional, but also mutually dependent:
@@ -115,7 +115,8 @@ the filter.</dd>
<dt><a name="path"></a>{@code android:path}
<br/>{@code android:pathPrefix}
<br/>{@code android:pathPattern}</dt>
-<dd>The path part of a URI. The {@code path} attribute specifies a complete
+<dd>The path part of a URI which must begin with a /.
+The {@code path} attribute specifies a complete
path that is matched against the complete path in an Intent object. The
{@code pathPrefix} attribute specifies a partial path that is matched against
only the initial part of the path in the Intent object. The {@code pathPattern}
diff --git a/docs/html/guide/topics/manifest/uses-feature-element.jd b/docs/html/guide/topics/manifest/uses-feature-element.jd
index 2385592..c1ccef0 100644
--- a/docs/html/guide/topics/manifest/uses-feature-element.jd
+++ b/docs/html/guide/topics/manifest/uses-feature-element.jd
@@ -143,12 +143,12 @@ features</a> tables, below. Descriptor string values are case-sensitive.</dd>
the feature specified in <code>android:name</code>.
<ul>
-<li>When you declare <code>"android:required="true"</code> for a feature,
+<li>When you declare <code>android:required="true"</code> for a feature,
you are specifying that the application <em>cannot function, or is not
designed to function</em>, when the specified feature is not present on the
device. </li>
-<li>When you declare <code>"android:required="false"</code> for a feature, it
+<li>When you declare <code>android:required="false"</code> for a feature, it
means that the application <em>prefers to use the feature</em> if present on
the device, but that it <em>is designed to function without the specified
feature</em>, if necessary. </li>
diff --git a/docs/html/guide/topics/manifest/uses-sdk-element.jd b/docs/html/guide/topics/manifest/uses-sdk-element.jd
index e5e64e5..3ac87ef 100644
--- a/docs/html/guide/topics/manifest/uses-sdk-element.jd
+++ b/docs/html/guide/topics/manifest/uses-sdk-element.jd
@@ -227,11 +227,16 @@ Versions dashboards page</a>.</p>
<table>
<tr><th>Platform Version</th><th>API Level</th><th>VERSION_CODE</th><th>Notes</th></tr>
+ <tr><td><a href="{@docRoot}about/versions/android-5.1.html">Android 5.1</a></td>
+ <td><a href="{@docRoot}sdk/api_diff/22/changes.html" title="Diff Report">22</a></td>
+ <td>{@link android.os.Build.VERSION_CODES#LOLLIPOP_MR1}</td>
+ <td rowspan="2"><a href="{@docRoot}about/versions/lollipop.html">Platform
+Highlights</a></td></tr>
+
<tr><td><a href="{@docRoot}about/versions/android-5.0.html">Android 5.0</a></td>
<td><a href="{@docRoot}sdk/api_diff/21/changes.html" title="Diff Report">21</a></td>
<td>{@link android.os.Build.VERSION_CODES#LOLLIPOP}</td>
- <td><a href="{@docRoot}about/versions/lollipop.html">Platform
-Highlights</a></td></tr>
+ </tr>
<tr><td style="color:#bbb">Android 4.4W</td>
<td><a href="{@docRoot}sdk/api_diff/20/changes.html" title="Diff Report">20</a></td>
diff --git a/docs/html/guide/topics/media/exoplayer.jd b/docs/html/guide/topics/media/exoplayer.jd
index 17b4669..1e8601f 100644
--- a/docs/html/guide/topics/media/exoplayer.jd
+++ b/docs/html/guide/topics/media/exoplayer.jd
@@ -72,10 +72,8 @@ page.tags="audio","video","adaptive","streaming","DASH","smoothstreaming"
<ul>
<li><a class="external-link" href="https://github.com/google/ExoPlayer/tree/master/library">
ExoPlayer Library</a> &mdash; This part of the project contains the core library classes.</li>
- <li><a class="external-link" href="https://github.com/google/ExoPlayer/tree/master/demo/src/main/java/com/google/android/exoplayer/demo/simple">
- Simple Demo</a> &mdash; This part of the app demonstrates a basic use of ExoPlayer.</li>
- <li><a class="external-link" href="https://github.com/google/ExoPlayer/tree/master/demo/src/main/java/com/google/android/exoplayer/demo/full">
- Full Demo</a> &mdash; This part of the app demonstrates more advanced features,
+ <li><a class="external-link" href="https://github.com/google/ExoPlayer/tree/master/demo">
+ Demo App</a> &mdash; This part of the project demonstrates usage of ExoPlayer,
including the ability to select between multiple audio tracks, a background audio mode,
event logging and DRM protected playback. </li>
</ul>
@@ -137,9 +135,10 @@ player.setPlayWhenReady(true);
player.release(); // Don’t forget to release when done!
</pre>
-<p>For a complete example, see the {@code SimplePlayerActivity} in the ExoPlayer demo app, which
- correctly manages an ExoPlayer instance with respect to both the {@link android.app.Activity} and
- {@link android.view.Surface} lifecycles.</p>
+<p>For a complete example, see {@code PlayerActivity} and {@code DemoPlayer} in the ExoPlayer demo
+ app. Between them these classes correctly manage an ExoPlayer instance with respect to both the
+ {@link android.app.Activity} and {@link android.view.Surface} lifecycles.
+</p>
<h2 id="samplesource">SampleSource</h2>
@@ -187,7 +186,7 @@ MediaCodecAudioTrackRenderer audioRenderer = new MediaCodecAudioTrackRenderer(
</pre>
<p>The ExoPlayer demo app provides a complete implementation of this code in
- {@code DefaultRendererBuilder}. The {@code SimplePlaybackActivity} class uses it to play one
+ {@code DefaultRendererBuilder}. The {@code PlayerActivity} class uses it to play one
of the videos available in the demo app. Note that in the example, video and audio
are muxed, meaning they are streamed together from a single URI. The {@code FrameworkSampleSource}
instance provides video samples to the {@code videoRenderer} object and audio samples to the
@@ -211,9 +210,9 @@ MediaCodecAudioTrackRenderer audioRenderer = new MediaCodecAudioTrackRenderer(
which loads chunks of media data from which individual samples can be extracted. Each {@code
ChunkSampleSource} requires a {@code ChunkSource} object to be injected through its constructor,
which is responsible for providing media chunks from which to load and read samples. The {@code
- DashMp4ChunkSource} and {@code SmoothStreamingChunkSource} classes provide DASH and SmoothStreaming
- playback using the FMP4 container format. The {@code DashWebMChunkSource} class uses the WebM
- container format to provide DASH playback.</p>
+ DashChunkSource} class provides DASH playback using the FMP4 and WebM container formats. The
+ {@code SmoothStreamingChunkSource} class provides SmoothStreaming playback using the FMP4
+ container format.</p>
<p>All of the standard {@code ChunkSource} implementations require a {@code FormatEvaluator} and
a {@code DataSource} to be injected through their constructors. The {@code FormatEvaluator}
@@ -242,7 +241,7 @@ BandwidthMeter bandwidthMeter = new BandwidthMeter();
// Build the video renderer.
DataSource videoDataSource = new HttpDataSource(userAgent,
HttpDataSource.REJECT_PAYWALL_TYPES, bandwidthMeter);
-ChunkSource videoChunkSource = new DashMp4ChunkSource(videoDataSource,
+ChunkSource videoChunkSource = new DashChunkSource(videoDataSource,
new AdaptiveEvaluator(bandwidthMeter), videoRepresentations);
ChunkSampleSource videoSampleSource = new ChunkSampleSource(videoChunkSource,
loadControl, VIDEO_BUFFER_SEGMENTS * BUFFER_SEGMENT_SIZE, true);
@@ -253,7 +252,7 @@ MediaCodecVideoTrackRenderer videoRenderer = new MediaCodecVideoTrackRenderer(
// Build the audio renderer.
DataSource audioDataSource = new HttpDataSource(userAgent,
HttpDataSource.REJECT_PAYWALL_TYPES, bandwidthMeter);
-ChunkSource audioChunkSource = new DashMp4ChunkSource(audioDataSource,
+ChunkSource audioChunkSource = new DashChunkSource(audioDataSource,
new FormatEvaluator.FixedEvaluator(), audioRepresentation);
SampleSource audioSampleSource = new ChunkSampleSource(audioChunkSource,
loadControl, AUDIO_BUFFER_SEGMENTS * BUFFER_SEGMENT_SIZE, true);
@@ -273,9 +272,8 @@ MediaCodecAudioTrackRenderer audioRenderer = new MediaCodecAudioTrackRenderer(
</p>
<p>The ExoPlayer demo app provides complete implementation of this code in
- {@code DashVodRendererBuilder}. The {@code SimplePlaybackActivity} class uses this builder to
- construct renderers for playing DASH sample videos in the demo app. It asynchronously fetches a
- specified MPD file in order to construct the required {@code Representation} objects. For an
+ {@code DashRendererBuilder}. The {@code PlayerActivity} class uses this builder to
+ construct renderers for playing DASH sample videos in the demo app. For an
equivalent SmoothStreaming example, see the {@code SmoothStreamingRendererBuilder} class in the
demo app.</p>
@@ -313,7 +311,7 @@ if (format.width * format.height &lt;= maxDecodableFrameSize) {
}
</pre>
-<p>This approach is used to filter {@code Representations} in the {@code DashVodRendererBuilder}
+<p>This approach is used to filter {@code Representations} in the {@code DashRendererBuilder}
class of the ExoPlayer demo app, and similarly to filter track indices in {@code
SmoothStreamingRendererBuilder}.</p>
@@ -372,24 +370,26 @@ boolean isAdaptive = MediaCodecUtil.getDecoderInfo(MimeTypes.VIDEO_H264).adaptiv
<p>In addition to high level listeners, many of the individual components provided by the
ExoPlayer library allow their own event listeners. For example, {@code
MediaCodecVideoTrackRenderer} has constructors that take a {@code
- MediaCodecVideoTrackRenderer.EventListener}. In the ExoPlayer demo app, {@code SimplePlayerActivity}
- acts as a listener so that it can adjust the dimensions of the target surface to have the correct
- height and width ratio for the video being played:</p>
+ MediaCodecVideoTrackRenderer.EventListener}. In the ExoPlayer demo app, {@code DemoPlayer}
+ acts as the listener to multiple individual components, forwarding events to {@code PlayerActivity}.
+ This approach allows {@code PlayerActivity} to adjust the dimensions of the target surface
+ to have the correct height and width ratio for the video being played:</p>
<pre>
&#64;Override
-public void onVideoSizeChanged(int width, int height) {
- surfaceView.setVideoWidthHeightRatio(height == 0 ? 1 : (float) width / height);
+public void onVideoSizeChanged(int width, int height, float pixelWidthAspectRatio) {
+ surfaceView.setVideoWidthHeightRatio(
+ height == 0 ? 1 : (width * pixelWidthAspectRatio) / height);
}
</pre>
-<p>The {@code RendererBuilder} classes in the ExoPlayer demo app inject the activity as the
- listener, for example in the {@code DashVodRendererBuilder} class:</p>
+<p>The {@code RendererBuilder} classes in the ExoPlayer demo app inject the {@code DemoPlayer} as
+ the listener to each component, for example in the {@code DashRendererBuilder} class:</p>
<pre>
MediaCodecVideoTrackRenderer videoRenderer = new MediaCodecVideoTrackRenderer(
- videoSampleSource, null, true, MediaCodec.VIDEO_SCALING_MODE_SCALE_TO_FIT,
- 0, <strong>mainHandler, playerActivity</strong>, 50);
+ sampleSource, null, true, MediaCodec.VIDEO_SCALING_MODE_SCALE_TO_FIT, 5000,
+ null, <strong>player.getMainHandler(), player</strong>, 50);
</pre>
<p>Note that you must pass a {@link android.os.Handler} object to the renderer, which determines
@@ -441,9 +441,7 @@ player.blockingSendMessage(videoRenderer,
<p>You must use a blocking message because the contract of {@link
android.view.SurfaceHolder.Callback#surfaceDestroyed surfaceDestroyed()} requires that the
- app does not attempt to access the surface after the method returns. The {@code
- SimplePlayerActivity} class in the demo app demonstrates how the surface should be set and
- cleared.</p>
+ app does not attempt to access the surface after the method returns.</p>
<h2 id="customizing">Customizing ExoPlayer</h2>
diff --git a/docs/html/guide/topics/resources/available-resources.jd b/docs/html/guide/topics/resources/available-resources.jd
index 19babee..db1bf8d 100644
--- a/docs/html/guide/topics/resources/available-resources.jd
+++ b/docs/html/guide/topics/resources/available-resources.jd
@@ -29,6 +29,7 @@ Saved in {@code res/color/} and accessed from the {@code R.color} class.</dd>
<dt><a href="{@docRoot}guide/topics/resources/drawable-resource.html">Drawable Resources</a></dt>
<dd>Define various graphics with bitmaps or XML.<br/>
Saved in {@code res/drawable/} and accessed from the {@code R.drawable} class.</dd>
+
<dt><a href="{@docRoot}guide/topics/resources/layout-resource.html">Layout Resource</a></dt>
<dd>Define the layout for your application UI.<br/>
Saved in {@code res/layout/} and accessed from the {@code R.layout} class.</dd>
diff --git a/docs/html/guide/topics/resources/providing-resources.jd b/docs/html/guide/topics/resources/providing-resources.jd
index 6d9527f..fc79970 100644
--- a/docs/html/guide/topics/resources/providing-resources.jd
+++ b/docs/html/guide/topics/resources/providing-resources.jd
@@ -60,18 +60,24 @@ MyProject/
MyActivity.java </span>
res/
drawable/ <span style="color:black">
- icon.png </span>
+ graphic.png </span>
layout/ <span style="color:black">
main.xml
info.xml</span>
+ mipmap/ <span style="color:black">
+ icon.png </span>
values/ <span style="color:black">
strings.xml </span>
</pre>
<p>As you can see in this example, the {@code res/} directory contains all the resources (in
-subdirectories): an image resource, two layout resources, and a string resource file. The resource
+subdirectories): an image resource, two layout resources, {@code mipmap/} directories for launcher
+icons, and a string resource file. The resource
directory names are important and are described in table 1.</p>
+<p class="note"><strong>Note:</strong> For more information about using the mipmap folders, see
+<a href="{@docRoot}tools/projects/index.html#mipmap">Managing Projects Overview</a>.</p>
+
<p class="table-caption" id="table1"><strong>Table 1.</strong> Resource directories
supported inside project {@code res/} directory.</p>
@@ -104,6 +110,7 @@ State List Resource</a></td>
<tr>
<td><code>drawable/</code></td>
+
<td><p>Bitmap files ({@code .png}, {@code .9.png}, {@code .jpg}, {@code .gif}) or XML files that
are compiled into the following drawable resource subtypes:</p>
<ul>
@@ -119,6 +126,13 @@ are compiled into the following drawable resource subtypes:</p>
</tr>
<tr>
+ <td><code>mipmap/</code></td>
+ <td>Drawable files for different launcher icon densities. For more information on managing
+ launcher icons with {@code mipmap/} folders, see
+ <a href="{@docRoot}tools/project/index.html#mipmap">Managing Projects Overview</a>.</td>
+ </tr>
+
+ <tr>
<td><code>layout/</code></td>
<td>XML files that define a user interface layout.
See <a href="layout-resource.html">Layout Resource</a>.</td>
diff --git a/docs/html/guide/topics/ui/layout/grid.jd b/docs/html/guide/topics/ui/layout/grid.jd
index c2f1321..3474f48 100644
--- a/docs/html/guide/topics/ui/layout/grid.jd
+++ b/docs/html/guide/topics/ui/layout/grid.jd
@@ -181,7 +181,7 @@ file.</p>
<li>Run the application.</li>
</ol>
<p>You should see the following:</p>
-<img src="images/hello-tablelayout.png" width="150px" />
+<img src="{@docRoot}guide/topics/ui/images/hello-tablelayout.png" width="150px" />
diff --git a/docs/html/guide/topics/ui/layout/gridview.jd b/docs/html/guide/topics/ui/layout/gridview.jd
index a4bf224..13467ae 100644
--- a/docs/html/guide/topics/ui/layout/gridview.jd
+++ b/docs/html/guide/topics/ui/layout/gridview.jd
@@ -70,8 +70,10 @@ public void onCreate(Bundle savedInstanceState) {
gridview.setAdapter(new ImageAdapter(this));
gridview.setOnItemClickListener(new OnItemClickListener() {
- public void onItemClick(AdapterView&lt;?> parent, View v, int position, long id) {
- Toast.makeText(HelloGridView.this, "" + position, Toast.LENGTH_SHORT).show();
+ public void onItemClick(AdapterView&lt;?> parent, View v,
+ int position, long id) {
+ Toast.makeText(HelloGridView.this, "" + position,
+ Toast.LENGTH_SHORT).show();
}
});
}
@@ -118,7 +120,8 @@ public class ImageAdapter extends BaseAdapter {
// create a new ImageView for each item referenced by the Adapter
public View getView(int position, View convertView, ViewGroup parent) {
ImageView imageView;
- if (convertView == null) { // if it's not recycled, initialize some attributes
+ if (convertView == null) {
+ // if it's not recycled, initialize some attributes
imageView = new ImageView(mContext);
imageView.setLayoutParams(new GridView.LayoutParams(85, 85));
imageView.setScaleType(ImageView.ScaleType.CENTER_CROP);